Page 1 of 1

Custom Login errorCode

Posted: 30 Jun 2012, 07:16
by grhwood
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

Re: Custom Login errorCode

Posted: 30 Jun 2012, 12:34
by rjgtav
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.

Re: Custom Login errorCode

Posted: 30 Jun 2012, 15:26
by Lapo
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

Re: Custom Login errorCode

Posted: 31 Jul 2015, 12:57
by Smartfoxer
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. :D

Source: http://docs2x.smartfoxserver.com/api-do ... 432b93.htm