Skip to content

Add createException method to ConvertibleClientHttpResponse in RestClient #35391

@rstoyanchev

Description

@rstoyanchev

retrieve() methods apply response status handling raising the appropriate RestClientResponseException. exchange() methods have a similar need, but must apply their own response status handling. Furthermore to decode the response body you need message converters, and there may be default status handlers configured on RestClient.Builder.

The motivation is very similar to #22825 for WebClient in 5.2. The same does not yet exist for RestClient. We can expose an additional method on ConvertibleClientHttpResponse to create a RestClientResponseException.

See #35375 (comment) for more background on how the need for this came up.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions