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

UnknownHttpStatusCodeException is missing the response body #24595

Conversation

awoodbury
Copy link
Contributor

@awoodbury awoodbury commented Feb 25, 2020

Updates DefaultResponseErrorHandler.handleError(ClientHttpReponse) to read
the response body once and reuse it for creating exception message and parameter.

Updates DefaultResponseErrorHandler.handleError(ClientHttpReponse) to read
response body once and reuse it for creating exception message and parameter.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 25, 2020
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Feb 26, 2020
@sbrannen
Copy link
Member

sbrannen commented Feb 26, 2020

Thanks for the PR.

Based on the provided tests, I assume the undesired behavior is an empty body in the UnknownHttpStatusCodeException for use cases where the InputStream has already been consumed by the first invocation of getResponseBody().

Just a few questions...

  • Did this once work correctly for you?
  • In which version or versions of Spring Framework do you witness the undesired behavior?

@sbrannen sbrannen added status: waiting-for-feedback We need additional information before we can continue type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 26, 2020
@sbrannen sbrannen changed the title Fixes UnknownHttpStatusCodeException response body Include response body in UnknownHttpStatusCodeException Feb 26, 2020
@sbrannen sbrannen added this to the 5.2.5 milestone Feb 26, 2020
@sbrannen sbrannen self-assigned this Feb 26, 2020
@awoodbury
Copy link
Contributor Author

Thanks for the PR.

Based on the provided tests, I assume the undesired behavior is an empty body in the UnknownHttpStatusCodeException for use cases where the InputStream has already been consumed by the first invocation of getResponseBody().

Just a few questions...

  • Did this once work correctly for you?
  • In which version or versions of Spring Framework do you witness the undesired behavior?

That is correct - the undesired behavior is the empty body in the UnknownHttpStatusCodeException.

Yes it used to work correctly in 5.1.10; and then upgraded to 5.2.3 and the undesired behavior appeared.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 26, 2020
@rstoyanchev
Copy link
Contributor

I believe this was introduced in this commit as part of #1956.

@rstoyanchev rstoyanchev added type: regression A bug that is also a regression and removed status: feedback-provided Feedback has been provided type: bug A general bug labels Feb 26, 2020
@rstoyanchev rstoyanchev changed the title Include response body in UnknownHttpStatusCodeException UnknownHttpStatusCodeException is missing the response body Feb 26, 2020
@sbrannen sbrannen closed this in 2fb13d4 Mar 17, 2020
sbrannen added a commit that referenced this pull request Mar 17, 2020
@sbrannen
Copy link
Member

This has been merged into master in 2fb13d4 and refined in 17140c8.

Thanks

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: regression A bug that is also a regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants