Skip to content

Commit

Permalink
Adapt UserController example to current ServerRequestObservationContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jun 14, 2023
1 parent 96ae03b commit 362e189
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class UserController {
@ExceptionHandler(MissingUserException.class)
ResponseEntity<Void> handleMissingUser(ServerWebExchange exchange, MissingUserException exception) {
// We want to record this exception with the observation
ServerRequestObservationContext.findCurrent(exchange)
ServerRequestObservationContext.findCurrent(exchange.getAttributes())
.ifPresent(context -> context.setError(exception));
return ResponseEntity.notFound().build();
}
Expand Down

0 comments on commit 362e189

Please sign in to comment.