Skip to content
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

Jackson unmarshalling failure messages should be improved #2897

Closed
johanandren opened this issue Jan 17, 2020 · 2 comments
Closed

Jackson unmarshalling failure messages should be improved #2897

johanandren opened this issue Jan 17, 2020 · 2 comments
Labels
3 - in progress Someone is working on this ticket hackathon Issues that could be tackled during a hackathon help wanted Identifies issues that the core team will likely not have time to work on t:java Issues related to the Java DSL t:marshalling
Milestone

Comments

@johanandren
Copy link
Member

Currently we wrap a failure to unmarshall with Jackson in an IllegalArgumentException with the text "Cannot unmarshal JSON as [type]" and then pass the exception with details as a cause, however when this ends up in the routing tree only the top level exception message is in the response body, and that isn't very useful for figuring out what is wrong with the request JSON.

I think we should provide the validation error details from Jackson in the exception message or have a specific exception type for the failure and handle that in the ExceptionHandler.

@johanandren johanandren added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted t:java Issues related to the Java DSL labels Jan 17, 2020
@jrudolph jrudolph added t:marshalling hackathon Issues that could be tackled during a hackathon help wanted Identifies issues that the core team will likely not have time to work on labels Jan 20, 2020
@jrudolph
Copy link
Contributor

Agreed.

johanandren added a commit to johanandren/akka-http that referenced this issue Jan 20, 2020
@johanandren johanandren added 3 - in progress Someone is working on this ticket and removed 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted labels Jan 20, 2020
@jrudolph jrudolph added this to the 10.2.0 milestone Jan 20, 2020
@jrudolph
Copy link
Contributor

Fixed in #2901.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - in progress Someone is working on this ticket hackathon Issues that could be tackled during a hackathon help wanted Identifies issues that the core team will likely not have time to work on t:java Issues related to the Java DSL t:marshalling
Projects
None yet
Development

No branches or pull requests

3 participants