Skip to content

Commit 362e189

Browse files
committed
Adapt UserController example to current ServerRequestObservationContext
See gh-30013
1 parent 96ae03b commit 362e189

File tree

1 file changed

+1
-1
lines changed
  • framework-docs/src/main/java/org/springframework/docs/integration/observability/httpserver/reactive

1 file changed

+1
-1
lines changed

framework-docs/src/main/java/org/springframework/docs/integration/observability/httpserver/reactive/UserController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class UserController {
2828
@ExceptionHandler(MissingUserException.class)
2929
ResponseEntity<Void> handleMissingUser(ServerWebExchange exchange, MissingUserException exception) {
3030
// We want to record this exception with the observation
31-
ServerRequestObservationContext.findCurrent(exchange)
31+
ServerRequestObservationContext.findCurrent(exchange.getAttributes())
3232
.ifPresent(context -> context.setError(exception));
3333
return ResponseEntity.notFound().build();
3434
}

0 commit comments

Comments
 (0)