Forum QuickConnect [solved] Error during player registration

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

[solved] Error during player registration

Postby markloika » January 24th, 2011, 4:00 am

I'd like to give an error message saying why a user registration failed, but it doesn't look like currently there's any way to do that. I created a user, and then purposefully tried creating another user with the same information. With the received error object I did this:

Code: Select all
trace(_error);
trace(_error.type);
trace(_error.message);
trace(_error.name);
trace(_error.getStackTrace());


And I got this:

Code: Select all
Error: A general error occured
There was an error with the registration fields, see the specific errors for details.
Error
Error: There was an error with the registration fields, see the specific errors for details.
   at <anonymous>()
   at <anonymous>()
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at flash.net::URLLoader/onComplete()


Is this a bug? Or is there some other way to interact with this error message that I'm not doing? It seems odd to me that tracing the message property wouldn't output anything. Also, the message property isn't an instance of the Message class, I tried:

Code: Select all
trace(_error.message.type);


That returned a null reference error.
Last edited by markloika on February 2nd, 2011, 6:39 am, edited 2 times in total.
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: Bug: Error during player registration

Postby Benjaminsen » January 24th, 2011, 9:33 am

Specifically registration has its own error type called PlayerIORegistrationError which contains the extra fields you are missing.

The docs do use PlayerIORegistrationError, but I will look into getting it updated with an example to lower confusion.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Bug: Error during player registration

Postby Henrik » January 24th, 2011, 3:52 pm

It's a bug in the documentation also. :-)

The PlayerIORegistrationError object has some properties on it that contain the errors for each field, it's just that the documentation page at http://playerio.com/documentation/refer ... ationerror doesn't show this. I've fixed this, and it will go out in the next release.

The properties you can use are called captchaError, emailError, usernameError and passwordError. If they contain anything, it will be the error for that specific piece of registration data, and you should probably show that to the user in the registration form.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Bug: Error during player registration

Postby markloika » January 24th, 2011, 10:57 pm

I didn't fully read the documentation :oops: Thanks for your help!
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: [solved] Error during player registration

Postby markloika » February 2nd, 2011, 6:32 am

Hah! I just realized I wasn't crazy. The docs DO use the wrong error class:

Code: Select all
01   //Register a user with QuickConnect for Simple Users
02   PlayerIO.quickConnect.simpleRegister(
03       stage,
04       '<your game id goes here>',
05       username,
06       password,
07       email,
08       null, // captcha key, if captcha is used
09       null, // captcha value, if captcha is used
10       {gender:'male',age:99}, // any additional data you want
11       function(client:Client):void{
12           //...
13       }, function(e:PlayerIOError):void{ //<<<< Wrong Error Class, should be PlayerIORegistrationError
14           trace("Error: ", e)
15       }
16   );


This is the example code that caused this error in the first place, notice the PlayerIOError class in the error function. This code snippet is on this page:

http://playerio.com/documentation/quick ... impleusers
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: [solved] Error during player registration

Postby Henrik » February 2nd, 2011, 12:34 pm

Thanks for catching it! We'll release updated docs soon. :-)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to QuickConnect



cron