Skip to content

Commit c1bd924

Browse files
committed
Merge branch '6.1.x'
2 parents e66d965 + f6bc828 commit c1bd924

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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
@@ -471,7 +471,7 @@ public Mono<ClientResponse> exchange() {
471471
final AtomicBoolean responseReceived = new AtomicBoolean();
472472
return responseMono
473473
.doOnNext(response -> responseReceived.set(true))
474-
.doOnError(observationContext::setError)
474+
.doOnError(observation::error)
475475
.doFinally(signalType -> {
476476
if (signalType == SignalType.CANCEL && !responseReceived.get()) {
477477
observationContext.setAborted(true);

spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientObservationTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ void recordsObservationForErrorExchange() {
110110
StepVerifier.create(client.get().uri("/path").retrieve().bodyToMono(Void.class))
111111
.expectError(IllegalStateException.class)
112112
.verify(Duration.ofSeconds(5));
113-
assertThatHttpObservation().hasLowCardinalityKeyValue("exception", "IllegalStateException")
113+
assertThatHttpObservation().hasError()
114+
.hasLowCardinalityKeyValue("exception", "IllegalStateException")
114115
.hasLowCardinalityKeyValue("status", "CLIENT_ERROR");
115116
}
116117

@@ -172,7 +173,7 @@ void recordsObservationWithResponseDetailsWhenFilterFunctionErrors() {
172173
StepVerifier.create(responseMono)
173174
.expectError(IllegalStateException.class)
174175
.verify(Duration.ofSeconds(5));
175-
assertThatHttpObservation()
176+
assertThatHttpObservation().hasError()
176177
.hasLowCardinalityKeyValue("exception", "IllegalStateException")
177178
.hasLowCardinalityKeyValue("status", "200");
178179
}

0 commit comments

Comments
 (0)