Is it in some way possible that an exception thrown from a rest service is returned as JSON? I have a JAX-RS Rest Service where I would like to achieve this. When I throw it
catch your exceptions, then build a response object in a standardized format such as
error: { code: 'XXX', status: HTTPStatus, message: 'my error message' }
And send it as a response with an error status (from Response.Status, usually 4xx or 5xx)