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

Response body available in both message and exception #24637

Closed

Conversation

nbaars
Copy link

@nbaars nbaars commented Mar 4, 2020

Observation

When the status code is unknown a message will be constructed but the thrown exception does not contain the body anymore.

Wanted behavior

The UnknownHttpStatusCodeException.getResponseBodyAsString() returns the body and does not return ""

Fix

Same as the method protected void handleError(ClientHttpResponse response, HttpStatus statusCode) assign the body to a local variable and use it in the message and pass that one to the constructor of the UnknownHttpStatusCodeException

@pivotal-issuemaster
Copy link

@nbaars Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@nbaars Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 4, 2020
@rstoyanchev rstoyanchev self-assigned this Mar 6, 2020
@rstoyanchev
Copy link
Contributor

@nbaars, this has already been reported in #24595. Thank you for pull request anyway!

@rstoyanchev rstoyanchev closed this Mar 6, 2020
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 6, 2020
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) status: duplicate A duplicate of another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants