Remove unnecessary error signal from DefaultRestClient
Before UnknownContentTypeException is thrown, it is added to the current Observation but since UnknownContentTypeException is a RestClientException, the exception is added again in one of the catch blocks later on. Closes gh-33347
This commit is contained in:
parent
36e84a5209
commit
6c74fee5e8
|
|
@ -220,13 +220,10 @@ final class DefaultRestClient implements RestClient {
|
|||
return (T) messageConverter.read((Class)bodyClass, responseWrapper);
|
||||
}
|
||||
}
|
||||
UnknownContentTypeException unknownContentTypeException = new UnknownContentTypeException(bodyType, contentType,
|
||||
|
||||
throw new UnknownContentTypeException(bodyType, contentType,
|
||||
responseWrapper.getStatusCode(), responseWrapper.getStatusText(),
|
||||
responseWrapper.getHeaders(), RestClientUtils.getBody(responseWrapper));
|
||||
if (observation != null) {
|
||||
observation.error(unknownContentTypeException);
|
||||
}
|
||||
throw unknownContentTypeException;
|
||||
}
|
||||
catch (UncheckedIOException | IOException | HttpMessageNotReadableException exc) {
|
||||
Throwable cause;
|
||||
|
|
|
|||
Loading…
Reference in New Issue