Skip to content

Commit 43566a0

Browse files
authored
Merge pull request #313 from cyb3r4nt/jsonrpc4j-fix-deprecated-http-message-exception
Use different constructor of HttpMessageNotReadableException in MappingJacksonRPC2HttpMessageConverter.readInternal()
2 parents aef7881 + 4d26766 commit 43566a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/googlecode/jsonrpc4j/spring/rest/MappingJacksonRPC2HttpMessageConverter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ protected boolean supports(Class<?> clazz) {
138138

139139
@Override
140140
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage)
141-
throws IOException, HttpMessageNotReadableException {
141+
throws HttpMessageNotReadableException {
142142

143143
JavaType javaType = getJavaType(clazz);
144144
try {
145145
return this.objectMapper.readValue(inputMessage.getBody(), javaType);
146146
} catch (IOException ex) {
147-
throw new HttpMessageNotReadableException("Could not read JSON: " + ex.getMessage(), ex);
147+
throw new HttpMessageNotReadableException(
148+
"Could not read JSON: " + ex.getMessage(),
149+
ex,
150+
inputMessage
151+
);
148152
}
149153
}
150154

0 commit comments

Comments
 (0)