-
Notifications
You must be signed in to change notification settings - Fork 357
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
JacksonFeature ExceptionMappers leaks implementation details #4200
Milestone
Comments
Fixed by #4225 |
This was referenced Jun 26, 2021
This was referenced Aug 5, 2021
This was referenced Sep 5, 2021
This was referenced Oct 4, 2021
This was referenced Oct 18, 2021
This was referenced Oct 21, 2021
Merged
Merged
Closed
Closed
This was referenced Oct 21, 2021
1 task
This was referenced Mar 7, 2022
This was referenced Mar 15, 2022
This was referenced Apr 17, 2022
This was referenced May 3, 2022
1 task
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
JacksonFeature
ExceptionMapper<JsonParseException>
andExceptionMapper<JsonMappingException>
Exception Mappers return the full error message as the Response body and there's no way to catch it and remove it.I have an
AutoValue
class that Jackson tries to convert from JSON, if there's an error in the conversion (myAutoValue
class doesn't accepts empty strings for itsname
field), I get a 400 Response with the text:I tried to use an
ExceptionMapper<Throwable>
to catch all exceptions, log them, and return an empty Response, but it didn't work. I also tried to make my own version of theExceptionMapper<JsonParseException>
andExceptionMapper<JsonMappingException>
as it was suggested to me, but this didn't work either (worked on Tomcat, but not on other servlet containers).Is it there a way to remove this body message?
Could you guys remove this or make it a separate module so only those interested would include it, and the rest of us could just catch those exceptions in our own Exception Mappers?
The text was updated successfully, but these errors were encountered: