You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main concept behind specifying the error attributes in `properties` file is **Error key**, which is mandatory to be unique for each error scenario.
330
+
The main concept behind specifying the error attributes in `properties` file is [*Error key*](https://github.com/officiallysingh/spring-boot-problem-handler#error-key), which is mandatory to be unique for each error scenario.
331
331
**It is either derived or specified by application** while throwing exception and used to externalize the error attributes in `properties` file.
332
332
333
333
For example if error key for some exception is `some.error.key`, then error response attributes can be specified in `properties` file as follows.
@@ -437,7 +437,7 @@ For example in case of `ConstraintViolationException` `codes` would be multiple
437
437
Respective codes for corresponding attribute can be copied and message can be specified for same in `properties` file.
438
438
439
439
> [!NOTE]
440
-
> `org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException` i.e. fully qualified name of exception is the **Error key** in above case.
440
+
> `org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException` i.e. fully qualified name of exception is the [*Error key*](https://github.com/officiallysingh/spring-boot-problem-handler#error-key) in above case.
441
441
**This scenario also covers all the exceptions for which advices are not defined**.
442
442
But additionally `HttpStatus` need to be specified in `properties` file as it has not been specified anywhere in code because `ControllerAdvice` is not defined,
443
443
if status not given even in `properties` file `HttpStatus.INTERNAL_SERVER_ERROR` is taken as default.
@@ -475,7 +475,7 @@ The simplistic way is to just specify a unique error key and `HttpStatus`.
0 commit comments