-
Notifications
You must be signed in to change notification settings - Fork 38.5k
ResponseEntityExceptionHandler is ignored [SPR-17521] #22053
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
Comments
Marrache Mickael commented I confirm this behavior occurs since version 5.0.9. I changed the affected version. |
Rossen Stoyanchev commented I can't think of anything that would have changed the treatment of
As for the extra warning should have been addressed with #21916. |
Marrache Mickael commented I checked again, the issue appears when upgrading Spring Boot from 2.0.4 to 2.0.5. Also, I am using Jetty - not sure if that may have an impact. May it be related to Spring Boot auto configuration then and not Spring? |
Rossen Stoyanchev commented It could be an issue in Boot but at this point, please provide demo code, or instructions how to reproduce. |
Marrache Mickael commented I attached a sample project reproducing the issue. |
Rossen Stoyanchev commented Hm, it doesn't seem to reproduce the issue for me (I tired 2.0.6 as well). On startup I see the method is detected:
For the request, I see the exception getting resolved through it:
And the response:
|
Rossen Stoyanchev commented I've added the source to the issues repository https://github.com/spring-projects/spring-framework-issues/tree/master/SPR-17521-2. |
Marrache Mickael commented Yes this is the observed behavior. If you try with v2.0.4 you will see something else (what I expect). In the logs you added, there is no entry logged by RestExceptionHandler (i.e. my custom handler). With v2.0.4, the entry exists. |
Rossen Stoyanchev commented I'm sorry but your project does not demonstrate the stated issue of " The RestExceptionHandler is detected on startup:
It is invoked at runtime:
The server returned the expected 400 response with error details. I've also used a breakpoint to verify it is being called. The log entry from RestExceptionHandler does appear once logging for com.test is set to DEBUG. |
Marrache Mickael commented You're right... for some reason the warning caused me to think that, not sure why I didn't reach the breakpoint with my debugger. Sorry for your time... |
Rossen Stoyanchev commented Ok no problem. |
Uh oh!
There was an error while loading. Please reload this page.
Marrache Mickael opened SPR-17521 and commented
When upgrading Spring Boot from version 2.0.4 to 2.0.6, the Spring dependencies are upgraded from version 5.0.8 to 5.0.10.
With the new version, my
@ControllerAdvice
is ignored, while it is not with the previous version.Moreover, I observe new warnings in the logs:
Affects: 5.0.9
Attachments:
Referenced from: commits spring-attic/spring-framework-issues@d98f55a, spring-attic/spring-framework-issues@b281f0e
The text was updated successfully, but these errors were encountered: