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

Comment From: pivotal-issuemaster

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

Comment From: pivotal-issuemaster

@nbaars Thank you for signing the Contributor License Agreement!

Comment From: rstoyanchev

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