-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Use URL and HTTP method in DefaultResponseErrorHandler #28958
Use URL and HTTP method in DefaultResponseErrorHandler #28958
Conversation
3a05fad
to
654d178
Compare
654d178
to
51245d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies this fell through again, but already too late for 6.1. We have looked into it however and discussed it. We plan to add it in 6.2.
One thing to keep in mind, the exception message should not include the full URI, in particular the query which may reveal sensitive info.
Also, now that we have both RestClient
and RestTemplate
, for extra context it's worth mentioning that while RestClient
makes it possible to use ResponseErrorHandler
, it also exposes its own ErrorHandler
interface that takes the request and response.
Hello Rossen! I'll resolve the conflicts then. I haven't followed this very closely. So let me ask a silly question - is there a chance that the behaviour stays consistent across WebClient, RestTemplate and RestClient? And one more - would you be open to more fine-tuning in the future? Thanks! |
Thanks very much @jerzykrlk! I've polished things up a bit to streamline thing. I've also changed the structure of the error message to be more compliant with other places in the framework. It now reads:
|
Hello Stéphane - thanks for accepting this! |
Good evening team,
This is a followup of a previous PR from January 2021: #26480 .
Previously it was closed with a conclusion that the change bypasses a protected method:
Now that Spring 6 is coming, do you think there's a chance to add this change?
Below is the original description of the PR:
======
The REST Client exception contains a preview of the body, which is great, and it helps a lot to quickly diagnose errors.
Now, the stacktrace looks like this:
I'd like to add the HTTP method and URL to the error, so that the stacktrace looks like this:
======
Thank you!