I can use onServer event for handling certain set of errors that are generated in the server.

But is there any way to send any custom errors from the server?