Hi,
I want to add some custom errorCodes return by server but the SFSErrorCodes class has a static errorsByCode array so the java client will throw ArrayIndexOutOfBoundsException.
Thanks
Custom Login errorCode
Re: Custom Login errorCode
Hi,
Well, currently you can't add more error codes. But as a workaround, you can send a custom errorMessage such as "50-This is an error", where the number is the error code and the text after the "-" is the errorMessage.
Well, currently you can't add more error codes. But as a workaround, you can send a custom errorMessage such as "50-This is an error", where the number is the error code and the text after the "-" is the errorMessage.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Custom Login errorCode
Actually there is no need to add new error codes in that Class you can create your own custom error Class and codes with just one caveat, that you don't reuse the error codes that already exist. At the moment the error codes from 0 to 42 are already taken and I would advise to create your custom codes starting from 200. This way there is no collision with the current ones and if in future updates we'll add new codes there will be no problems as well.
Here's a quick guide on how to do it: viewtopic.php?f=18&t=14390
Let me know if there's any problem
cheers
Here's a quick guide on how to do it: viewtopic.php?f=18&t=14390
Let me know if there's any problem
cheers
-
- Posts: 9
- Joined: 18 Jul 2015, 14:32
Re: Custom Login errorCode
rjgtav wrote:Hi,
Well, currently you can't add more error codes. But as a workaround, you can send a custom errorMessage such as "50-This is an error", where the number is the error code and the text after the "-" is the errorMessage.
Hello,
actually that is what I am looking for.
But I see no way of how to retrive this information on the client side from the sent SFSErrorData object.
Any information would be much appreciated!
Thanks
James
EDIT: Never mind, my buddy found what we where looking for. Retrieve the sent information using errorMessage or errorCode.
Source: http://docs2x.smartfoxserver.com/api-do ... 432b93.htm
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 49 guests