Translate EOF to HttpMessageNotReadableException
The MappingJacksonHttpMessageConverter now catches all IOException types raised while reading JSON and translates them into HttpMessageNotReadableException. Issue: SPR-9238
This commit is contained in:
@@ -148,7 +148,7 @@ public class MappingJackson2HttpMessageConverter extends AbstractHttpMessageConv
|
||||
try {
|
||||
return this.objectMapper.readValue(inputMessage.getBody(), javaType);
|
||||
}
|
||||
catch (JsonProcessingException ex) {
|
||||
catch (IOException ex) {
|
||||
throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class MappingJacksonHttpMessageConverter extends AbstractHttpMessageConve
|
||||
try {
|
||||
return this.objectMapper.readValue(inputMessage.getBody(), javaType);
|
||||
}
|
||||
catch (JsonProcessingException ex) {
|
||||
catch (IOException ex) {
|
||||
throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
1
src/dist/changelog.txt
vendored
1
src/dist/changelog.txt
vendored
@@ -17,6 +17,7 @@ Changes in version 3.2 M1
|
||||
* add pretty print option to Jackson HttpMessageConverter and View types
|
||||
* fix issue with resolving Errors controller method argument
|
||||
* detect controller methods via InitializingBean in RequestMappingHandlerMapping
|
||||
* translate IOException from Jackson to HttpMessageNotReadableException
|
||||
|
||||
Changes in version 3.1.1 (2012-02-16)
|
||||
-------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user