Merge branch '6.1.x'

This commit is contained in:
Brian Clozel
2024-04-20 19:46:23 +02:00
2 changed files with 26 additions and 7 deletions

View File

@@ -232,13 +232,13 @@ final class DefaultRestClient implements RestClient {
}
throw unknownContentTypeException;
}
catch (UncheckedIOException | IOException | HttpMessageNotReadableException ex) {
catch (UncheckedIOException | IOException | HttpMessageNotReadableException exc) {
Throwable cause;
if (ex instanceof UncheckedIOException uncheckedIOException) {
if (exc instanceof UncheckedIOException uncheckedIOException) {
cause = uncheckedIOException.getCause();
}
else {
cause = ex;
cause = exc;
}
RestClientException restClientException = new RestClientException("Error while extracting response for type [" +
ResolvableType.forType(bodyType) + "] and content type [" + contentType + "]", cause);
@@ -247,6 +247,12 @@ final class DefaultRestClient implements RestClient {
}
throw restClientException;
}
catch (RestClientException restClientException) {
if (observation != null) {
observation.error(restClientException);
}
throw restClientException;
}
finally {
if (observation != null) {
observation.stop();