WebClient throws ClassCastException for bodyToMono(ParameterizedTypeReference)
Prior to this commit, the `WebClient` always throws a `ClassCastException` when an error occurs in `bodyToMono(ParameterizedTypeReference)``, and not the expected exception, as set up by `onStatus` Issue: SPR-16025
This commit is contained in:
@@ -418,7 +418,7 @@ class DefaultWebClient implements WebClient {
|
||||
public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) {
|
||||
return this.responseMono.flatMap(
|
||||
response -> bodyToPublisher(response, BodyExtractors.toMono(typeReference),
|
||||
mono -> (Mono<T>)mono));
|
||||
this::monoThrowableToMono));
|
||||
}
|
||||
|
||||
private <T> Mono<T> monoThrowableToMono(Mono<? extends Throwable> mono) {
|
||||
|
||||
Reference in New Issue
Block a user