You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with 6.2.0, Spring Web's DefaultResponseErrorHandler has changed in such a way that org.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 reporting
The real bug is that the code does not simply implement the ResponseErrorHandler interface but extends the DefaultResponseErrorHandler 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 returning false, which is even more efficient than having an empty handleError impl.
The text was updated successfully, but these errors were encountered:
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.
So feel free to close this issue as invalid / already fixed, but please consider to change the implementation to just implement the interface rather than extending the DefaultResponseErrorHandler as it's simpler and safer.
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: