-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Error handling override in DefaultResponseErrorHandler ignored after upgrade to 6.2.0 #33980
Comments
Thanks for the report. Technically not a regression since the goal in #28958 was switch to the new method, but we didn't document it in the migration notes, and I think we can make it backwards compatible by making We'll also deprecate the |
Switching to the new method is fine, but right now the 1-argument ' |
We're not removing the method yet, only deprecating it, and during the deprecation phase it will continue to be called. This is why I put the "regression" label. |
The change is now available in 6.2.1-SNAPSHOT if you want to give it a try. |
Without checking the snapshot in apps that i'm supporting (i don't have direct Access to spring snapshot versions in my workplace) i can tell that i see a problem with this solution. I know that is maybe unusual situation that i have custom noop error handler but IT is like that. So in that case it's not solving all of the issues (but at least custom error handling will work) as i would need to change all of the custom noop error handlers to NoopResponseErrorHandler provided by spring. And it would still be failing silently. For me the proposed solution doesn't fully solve the bug introduced in 6.2.0. I understand that the handleError(response) will be removed, but for now bumping spring dependency should not break valid flow. In 6.2.0 it wasn't working at all, with this snapshot i can end with processing both handleError methods. |
I'm re-opening to address the remaining concerns. Fair point that an ResponseErrorHandler could choose to suppress an error status, and not to throw an exception. We would need some actual side effect in handleError(response) to tell if it was overridden. |
@rstoyanchev We saw a similar issue and got around it by also implementing the So while this wouldn't be an issue in our scenario, wasn't sure if there was a concern about custom code that uses a |
Change introduced in spring 6.2.0 changes the behavior of
DefaultResponseErrorHandler
.Until now
spring-framework/spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java
Line 161 in 5024bb7
handleError(ClientHttpResponse response)
method, right now the behavior is broken and the said method is not being called.In classess derived from the
DefaultResponseErrorHandler
when overriding onlyhandleError(ClientHttpResponse response)
, the error handling stops working properly, as now the call to the method is completely ommited.This happened without any notice in release notes, my custom error handler stopped working, errors were only default processed.
The text was updated successfully, but these errors were encountered: