TypeMismatchException instead of IllegalArgumentException: argument type mismatch for wrong RequestBody [SPR-7263] #11922
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Gerrit Brehmer opened SPR-7263 and commented
If a controller method is called with a wrong (but for message converter known type)
@RequestBody
message, an java internal reflection exception will be raised: java.lang.IllegalArgumentException: argument type mismatch.It would be nice, if a Spring-TypeMismatchException exception could be raised instead (so a type check is needed). This exception is already mapped to a 400 Bad Request. With IllegalArgumentException the cause of the exception is not exactly enough.
Affects: 3.0.2
Attachments:
Referenced from: commits 65885d1, 723f94f
The text was updated successfully, but these errors were encountered: