Page 2 of 2

Re: Guide: Create Custom Errors

Posted: 16 Sep 2015, 17:33
by Lapo
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