Browse Source

Update docs

On the order of a ControllerAdvice that overrides the handling of
built-in exceptions in a scenario with Boot autoconfig.

Closes gh-35982
pull/36110/head
rstoyanchev 3 weeks ago
parent
commit
46efd930f0
  1. 7
      framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc
  2. 7
      framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

7
framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc

@ -66,6 +66,13 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro @@ -66,6 +66,13 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro
`@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the
`ProblemDetail` of an exception into a subclass with the additional non-standard fields.
TIP: In Spring Boot, the `spring.webflux.problemdetails.enabled` property autoconfigures
a `ResponseEntityExceptionHandler` that handles built-in exceptions with problem details.
In that case, you may prefer to create another `@ControllerAdvice` instead of extending
`ResponseEntityExceptionHandler` if you want to take over the handling of a specific
built-in exception. You'll need to ensure your handler is ordered ahead of the one
configured by Spring Boot whose order is 0.
[[webflux-ann-rest-exceptions-i18n]]
== Customization and i18n

7
framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

@ -66,6 +66,13 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro @@ -66,6 +66,13 @@ from an existing `ProblemDetail`. This could be done centrally, for example, fro
`@ControllerAdvice` such as `ResponseEntityExceptionHandler` that re-creates the
`ProblemDetail` of an exception into a subclass with the additional non-standard fields.
TIP: In Spring Boot, the `spring.mvc.problemdetails.enabled` property autoconfigures
a `ResponseEntityExceptionHandler` that handles built-in exceptions with problem details.
In that case, you may prefer to create another `@ControllerAdvice` instead of extending
`ResponseEntityExceptionHandler` if you want to take over the handling of a specific
built-in exception. You'll need to ensure your handler is ordered ahead of the one
configured by Spring Boot whose order is 0.
[[mvc-ann-rest-exceptions-i18n]]
== Customization and i18n

Loading…
Cancel
Save