Remove ErrorAttributes.ERROR_ATTRIBUTE
This commit removes the now defunkt `ErrorAttributes.ERROR_ATTRIBUTE` that was introduce to register handled errors as metrics. This has been replaced since 3.0 by a direct support in Spring Framework and had no effect whatsoever since that release. This also updates the documentation to point to the Framework mechanism that replaced it. Fixes gh-33731
This commit is contained in:
@@ -189,10 +189,8 @@ include::code:MyErrorWebExceptionHandler[]
|
||||
|
||||
For a more complete picture, you can also subclass `DefaultErrorWebExceptionHandler` directly and override specific methods.
|
||||
|
||||
In some cases, errors handled at the controller or handler function level are not recorded by the <<actuator#actuator.metrics.supported.spring-webflux, metrics infrastructure>>.
|
||||
Applications can ensure that such exceptions are recorded with the request metrics by setting the handled exception as a request attribute:
|
||||
|
||||
include::code:MyExceptionHandlingController[]
|
||||
In some cases, errors handled at the controller level are not recorded by web observations or the <<actuator#actuator.metrics.supported.spring-webflux, metrics infrastructure>>.
|
||||
Applications can ensure that such exceptions are recorded with the observations by {spring-framework-docs}/integration/observability.html#observability.http-server.reactive[setting the handled exception on the observation context].
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -355,10 +355,8 @@ include::code:MyControllerAdvice[]
|
||||
|
||||
In the preceding example, if `MyException` is thrown by a controller defined in the same package as `SomeController`, a JSON representation of the `MyErrorBody` POJO is used instead of the `ErrorAttributes` representation.
|
||||
|
||||
In some cases, errors handled at the controller level are not recorded by the <<actuator#actuator.metrics.supported.spring-mvc, metrics infrastructure>>.
|
||||
Applications can ensure that such exceptions are recorded with the request metrics by setting the handled exception as a request attribute:
|
||||
|
||||
include::code:MyController[]
|
||||
In some cases, errors handled at the controller level are not recorded by web observations or the <<actuator#actuator.metrics.supported.spring-mvc, metrics infrastructure>>.
|
||||
Applications can ensure that such exceptions are recorded with the observations by {spring-framework-docs}/integration/observability.html#observability.http-server.servlet[setting the handled exception on the observation context].
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user