From 81125de6979b84f8cf30ea31c372e87dde98d9a4 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Thu, 14 Sep 2017 14:15:05 +0200 Subject: [PATCH] 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 --- .../web/reactive/function/client/DefaultWebClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java index e790628e21..f888282ea2 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java @@ -422,7 +422,7 @@ class DefaultWebClient implements WebClient { public Mono bodyToMono(ParameterizedTypeReference typeReference) { return this.responseMono.flatMap( response -> bodyToMono(response, BodyExtractors.toMono(typeReference), - mono -> (Mono)mono)); + this::monoThrowableToMono)); } private Mono monoThrowableToMono(Mono mono) {