Skip to content

DefaultRestClient: readWithMessageConverters: retain the statusCode #33407

@puce77

Description

@puce77

Affects: 6.1.10

org.springframework.web.client.DefaultRestClient:

If a response cannot be parsed (readWithMessageConverters), a RestClientException (or a subclass) gets thrown instead of the specific subclass RestClientResponseException, making the original responseBody and statusCode very hidden in nested causes.

In such cases a RestClientResponseException should be thrown, so that there is a clean API for getting the statusCode and the original responseBody.

Common base class for exceptions that contain actual HTTP response data.

private <T> T readWithMessageConverters(ClientHttpResponse clientResponse, Runnable callback, Type bodyType,

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions