[JERSEY-2806] Jackson serialization exception is sent in response - Java.net JIRA
The JacksonFeature installs these:
// add the default Jackson exception mappers context.register(JsonParseExceptionMapper.class); context.register(JsonMappingExceptionMapper.class);
Those are the ones responsible for the rendered exception.
Based on their javadocs, I would say they are more made for handling JSON data coming on the request-side, rather than response:
Implementation of ExceptionMapper to send down a "400 Bad Request" in the event unparsable JSON is received.
It makes sense when incoming JSON cannot be mapped, but when outgoing JSON fails to render, I would say it's 500 Internal Server Error, rather than 400 Bad request.
Read full article from [JERSEY-2806] Jackson serialization exception is sent in response - Java.net JIRA
No comments:
Post a Comment