-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for details of HttpMessageNotReadableException #65
Conversation
This removes the burden of implementations to declare it as a checked exception in their throws clause. Fixes #56
@@ -26,6 +26,32 @@ public void missingRequestBody() throws Exception { | |||
.andExpect(jsonPath("$.detail", containsString("request body is missing"))); | |||
} | |||
|
|||
// TODO: jackson stuff tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other common exception causes:
InvalidFormatException
(e.g. haveBigDecimal
field butfoobar
on the wire)JsonMappingException
with no further cause due toNo suitable constructor found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the first one is a
Specialized sub-class of {@link JsonMappingException}
and Throwables.getRootCause
will return this if no cause was found. I think we should be safe here. I'll add two tests though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and Throwables.getRootCause will return
Which I'm not using anymore in the current version... 😄
I looked into the location/path but it will only contain what's part of the message anyway. Adding a new property would in theory require to register a new problem type. Feels like overkill to me, especially since nobody should handle that problem programmatically. It's almost certainly a bug. |
👍 |
Were there no changes to help improve this issue? I have the same problem. |
@kmandeville We cross-linked a couple of issues here. Can you be more specific? |
Fixes #1
Fixes #56