Skip to content
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 details in RestTemplate client and server exceptions #1956

Closed

Conversation

jerzykrlk
Copy link

@jerzykrlk jerzykrlk commented Sep 11, 2018

This pull request supersedes #21667 that contains the original description and discussion.

@snicoll snicoll changed the title SPR-17130 http error details in the exception message SPR-17130 - http error details in the exception message Sep 19, 2018
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 24, 2019
rstoyanchev added a commit that referenced this pull request Nov 13, 2019
@rstoyanchev rstoyanchev changed the title SPR-17130 - http error details in the exception message Error details in RestTemplate client and server exceptions Nov 13, 2019
@rstoyanchev rstoyanchev self-assigned this Nov 13, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 13, 2019
@rstoyanchev rstoyanchev added this to the 5.2.2 milestone Nov 13, 2019
@rstoyanchev
Copy link
Contributor

I have processed this pull request with some modifications.

  1. I removed the strategy as I don't think there is a need for a hierarchy to format an error message. I don't foresee much need to customize it and if that arises it can be solved with a protected method, or even by re-introducing the strategy in the future.
  2. There were some backwards compatibility issues. Notably ExtractingResponseErrorHandler was broken because of the overridden handleError with URL and HTTP method, but other signatures needed to be added to preserve existing public APIs.
  3. Passing the URL and HTTP method proved problematic and made it more difficult to preserve backwards compatibility, so I've dropped those altogether. While it is nice to include those in the error details I've left that part to be solved separately so this PR can move forward.

artembilan added a commit to spring-projects/spring-integration that referenced this pull request Nov 13, 2019
@jerzykrlk
Copy link
Author

Hi,

1 - Makes perfect sense. My use case is a bit specific - in error responses I sometimes need to strip HTML tags (some apps return HTML errors on REST endpoints), sometimes XML (same issue), to see the actual problem.

2, 3 - I wasn't aware of that. Thanks for your input, I'll try to find something suitable.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants