You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When utilizing a @Controller method with annotation @RequestBody and 'application/json' content type with Jackson on the classpath, MappingJacksonHttpMessageConverter throws a 'JsonParseException' (subclass of IOException) when given invalid JSON.
According to AbstractHttpMessageConverter.readInternal()'s documentation, the HttpMessageNotReadableException exception is more appropriate for conversion errors.
The side effect of this is that DefaultHandlerExceptionResolver throws a 500 Internal Server Error instead of the expected 400 Bad Request.
In the case that the message body is missing a java.io.EOFException is thrown. An org.springframework.http.converter.HttpMessageNotReadableException is more appropriate in this case as well.
Activity
spring-projects-issues commentedon Aug 11, 2010
Arjen Poutsma commented
Done, thanks for spotting this!
spring-projects-issues commentedon Feb 1, 2011
Matt Zimmer commented
In the case that the message body is missing a java.io.EOFException is thrown. An org.springframework.http.converter.HttpMessageNotReadableException is more appropriate in this case as well.
spring-projects-issues commentedon Jun 6, 2011
Arjen Poutsma commented
Fixed for 3.1