Skip to content

Commit 13403d5

Browse files
committed
Improve error message for missing request body
Issue: SPR-12888
1 parent de9675b commit 13403d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ protected <T> Object readWithMessageConverters(NativeWebRequest webRequest, Meth
147147
Object arg = readWithMessageConverters(inputMessage, methodParam, paramType);
148148
if (arg == null) {
149149
if (methodParam.getParameterAnnotation(RequestBody.class).required()) {
150-
throw new HttpMessageNotReadableException("Required request body is missing: " + methodParam);
150+
throw new HttpMessageNotReadableException("Required request body is missing: " +
151+
methodParam.getMethod().toGenericString());
151152
}
152153
}
153154

0 commit comments

Comments
 (0)