From 180d3aee65f364ab0ffb08e131ae60cb35c092d2 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Fri, 28 Apr 2023 09:04:57 +0200 Subject: [PATCH 1/2] Update example how to configure NoHandlerAdviceTrait --- problem-spring-web/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/problem-spring-web/README.md b/problem-spring-web/README.md index 6af46915..f2141f24 100644 --- a/problem-spring-web/README.md +++ b/problem-spring-web/README.md @@ -93,8 +93,9 @@ in addition also requires the following configuration: ```yaml spring: - resources: - add-mappings: false + web: + resources: + add-mappings: false mvc: throw-exception-if-no-handler-found: true ``` From 9e23d36b4f746f8e249e51cf4c5ce1b82a6c6e27 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Fri, 28 Apr 2023 09:12:36 +0200 Subject: [PATCH 2/2] Added documentation when using already a ContollerAdvice --- problem-spring-web/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problem-spring-web/README.md b/problem-spring-web/README.md index f2141f24..86a1ea6a 100644 --- a/problem-spring-web/README.md +++ b/problem-spring-web/README.md @@ -88,6 +88,8 @@ class ExceptionHandling implements ProblemHandling { } ``` +In case you are already have a ControllerAdvice, you may want to adjust your code to solely rely on this library, or set a `@Order(Ordered.HIGHEST_PRECEDENCE)` in your existing Advice for specific exceptions and leave the others for the library to handle. + The [`NoHandlerFoundAdviceTrait`](src/main/java/org/zalando/problem/spring/web/advice/routing/NoHandlerFoundAdviceTrait.java) in addition also requires the following configuration: