Skip to content

Commit dbb3a9a

Browse files
committed
Merge branch '6.1.x'
2 parents 873c9fe + 6c74fee commit dbb3a9a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spring-web/src/main/java/org/springframework/web/client/DefaultRestClient.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,10 @@ else if (messageConverter.canRead(bodyClass, contentType)) {
237237
return (T) messageConverter.read((Class)bodyClass, responseWrapper);
238238
}
239239
}
240-
UnknownContentTypeException unknownContentTypeException = new UnknownContentTypeException(bodyType, contentType,
240+
241+
throw new UnknownContentTypeException(bodyType, contentType,
241242
responseWrapper.getStatusCode(), responseWrapper.getStatusText(),
242243
responseWrapper.getHeaders(), RestClientUtils.getBody(responseWrapper));
243-
if (observation != null) {
244-
observation.error(unknownContentTypeException);
245-
}
246-
throw unknownContentTypeException;
247244
}
248245
catch (UncheckedIOException | IOException | HttpMessageNotReadableException exc) {
249246
Throwable cause;

0 commit comments

Comments
 (0)