Skip to content

After #1117 the response body is not available on errors if the content-type is application/json #1259

Open
@david-m-s

Description

@david-m-s

This is related to changes introduced in #1117
The previous implementation of HttpSyncGraphQlTransport#execut used RestClient#retrieve, so when there was an error it threw an HttpClientErrorException or HttpServerErrorException which contained the response body. That could be logged and was useful for troubleshooting.
Currently, if the server uses the old content-type (application/json), as RestClient#exchange is used the exception thrown is only HttpClientErrorException (note there is no implementation for 5xx responses, so a client exception will be thrown) and it does not contain the response body.
I think it would be useful to keep the response body in the exceptions and also to keep the HttpServerErrorException behavior.

Metadata

Metadata

Assignees

Labels

in: webIssues related to web handlingtype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions