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:
Rossen Stoyanchev
2012-05-10 17:17:29 -04:00
parent d7efc0db80
commit 816c1f47a4
3 changed files with 3 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}