-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
spring-cloud-gateway-mvc's ProxyExchange no longer ignores client errors when combined with Spring 6.2 #3604
Comments
Is there a simple way to reproduce this? |
proxy-exchange-errorhandling.zip |
Oh, while creating the sample project I just noticed that the relevant code has been updated in the latest release candidate: I didn't see that before. I do still think that the fix is not very good because the code should just implement the interface rather than adapt to the default impl by overwriting more methods (not futureproof, no compiler warnings if the impl ever changes again) but my bug report is invalid / only applicable to the released version of spring-cloud-gateway-mvc, which isn't officially compatible with Spring web 6.2.0 I guess. |
Starting with 6.2.0, Spring Web's
DefaultResponseErrorHandler
has changed in such a way thatorg.springframework.cloud.gateway.mvc.config.ProxyResponseAutoConfiguration.NoOpResponseErrorHandler
is no longer an actual no-op implementation. This results in client errors becoming exceptions instead of being proxied as-is, which is a very breaking change! UPDATE: only true for release train 2023.0.3, not for latest 2024.0.0-RC1: I didn't check when reportingThe real bug is that the code does not simply implement the
ResponseErrorHandler
interface but extends theDefaultResponseErrorHandler
while making assumptions about its implementation that no longer hold.The fix therefore is to implement a new trivial NoOpResponseErrorHandler directly: I would recommend to (also) implement the
hasError
method by returningfalse
, which is even more efficient than having an emptyhandleError
impl.The text was updated successfully, but these errors were encountered: