Skip to content

Commit 81125de

Browse files
committed
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
1 parent 98b6491 commit 81125de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public <T> Mono<T> bodyToMono(Class<T> bodyType) {
422422
public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) {
423423
return this.responseMono.flatMap(
424424
response -> bodyToMono(response, BodyExtractors.toMono(typeReference),
425-
mono -> (Mono<T>)mono));
425+
this::monoThrowableToMono));
426426
}
427427

428428
private <T> Mono<T> monoThrowableToMono(Mono<? extends Throwable> mono) {

0 commit comments

Comments
 (0)