Guide: Create Custom Errors

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 19933
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Guide: Create Custom Errors

Postby Lapo » 16 Sep 2015, 17:33

I think the problem here is that you're trying to send java classes to the client, but they aren't serializable.
The easiest way to send custom errors from server side is to send a code, or a code and a bunch of parameters, if needed. Which you're already doing.

Then the code gets translated to a message on the client side.

I wouldn't recommend generating the error string on the server side, since any change will require recompilation, re-deploy etc... and it's an extra pain if you need to localize errors. Much easier to have a (localized) client side xml file (or equivalent) with the code --> to --> message translation.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 6 guests