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
master
Brian Clozel 7 years ago
parent 98b6491f0c
commit 81125de697
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

@ -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) {

Loading…
Cancel
Save