Fix error responses handling in WebClient

This commit fixes a typo in the `DefaultWebClient` implementation.
Instead of forwarding resolved `WebClientException` instances as error
signals, the `bodyToMono(ParameterizedTypeReference)` variant would just
forward those exceptions as `onNext` signals.

Issue: SPR-15946
This commit is contained in:
Brian Clozel
2017-09-14 14:15:05 +02:00
parent 98b6491f0c
commit 81125de697

View File

@@ -422,7 +422,7 @@ class DefaultWebClient implements WebClient {
public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) {
return this.responseMono.flatMap(
response -> bodyToMono(response, BodyExtractors.toMono(typeReference),
mono -> (Mono<T>)mono));
this::monoThrowableToMono));
}
private <T> Mono<T> monoThrowableToMono(Mono<? extends Throwable> mono) {