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 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
@jerzykrlk jerzykrlk force-pushed the jerzykrlk:SPR-17130-response-preview branch from f0296d8 to fcda0ad Dec 29, 2018
@jerzykrlk jerzykrlk force-pushed the jerzykrlk:SPR-17130-response-preview branch from fcda0ad to 8d0a176 Apr 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 this to the 5.2.2 milestone Nov 13, 2019
@rstoyanchev

This comment has been minimized.

Copy link
Contributor

rstoyanchev commented Nov 13, 2019

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

This comment has been minimized.

Copy link
Author

jerzykrlk commented Nov 18, 2019

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.

artembilan added a commit to artembilan/spring-integration that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.