Skip to content

Response body available in both message and exception - #24637

Closed
nbaars wants to merge 1 commit into
spring-projects:masterfrom
nbaars:body_unknown_error_code
Closed

Response body available in both message and exception#24637
nbaars wants to merge 1 commit into
spring-projects:masterfrom
nbaars:body_unknown_error_code

Conversation

@nbaars

@nbaars nbaars commented Mar 4, 2020

Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

@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
Copy Markdown
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.

4 participants