Skip to content

Commit 6bd43f2

Browse files
Docs updated
1 parent d6d6d76 commit 6bd43f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ all can be done with zero custom code but by specifying error details in `proper
2525

2626
## Installation
2727

28-
> **Current version: 1.5** Refer to [Release notes](https://github.com/officiallysingh/spring-boot-problem-handler/releases/tag/1.4) while upgrading
28+
> **Current version: 1.5** Refer to [Release notes](https://github.com/officiallysingh/spring-boot-problem-handler/releases/tag/1.5) while upgrading
2929
3030
Add the `spring-boot-problem-handler` jar to application dependencies. That is all it takes to get a default working
3131
exception handling mechanism in a Spring boot application.
3232

3333
```xml
3434
<properties>
35-
<spring-boot-problem-handler.version>1.4</spring-boot-problem-handler.version>
35+
<spring-boot-problem-handler.version>1.5</spring-boot-problem-handler.version>
3636
</properties>
3737
```
3838

@@ -133,7 +133,9 @@ or [**`ProblemHandlingWebflux`**](src/main/java/com/ksoot/problem/spring/advice/
133133
| `├──`[**`DataIntegrityViolationAdviceTrait`**](src/main/java/com/ksoot/problem/spring/advice/dao/DataIntegrityViolationAdviceTrait.java) | [`500 Internal Server Error`](https://httpstatus.es/500) | data.integrity.violation.\<Failed DB constraint name\> |
134134
| `└──`[**`DuplicateKeyExceptionAdviceTrait`**](src/main/java/com/ksoot/problem/spring/advice/dao/DuplicateKeyExceptionAdviceTrait.java) | [`500 Internal Server Error`](https://httpstatus.es/500) | data.integrity.violation.\<Failed DB constraint name\> |
135135

136-
These advices are autoconfigured as a bean `DaoExceptionHandler` if following conditions are true
136+
These advices are autoconfigured as [**`WebDaoExceptionHandler`**](src/main/java/com/ksoot/problem/spring/boot/autoconfigure/web/WebDaoExceptionHandler.java)
137+
or [**`WebFluxDaoExceptionHandler`**](src/main/java/com/ksoot/problem/spring/boot/autoconfigure/webflux/WebFluxDaoExceptionHandler.java)
138+
for Spring Web and Spring Webflux respectively, if following conditions are true
137139
* `problem.dao-advice-enabled` is not set to `false`. Its default value is `true`
138140
* If using relation databases then `spring-data-jpa` jar is detected in classpath and either `spring.datasource.url` or `spring.r2dbc.url` is configured
139141
* If using MongoDB then `spring-data-mongodb` jar is detected in classpath and `spring.data.mongodb.uri` is configured
@@ -162,7 +164,7 @@ and [**`ProblemAccessDeniedHandler`**](src/main/java/com/ksoot/problem/spring/ad
162164
are autoconfigured as `authenticationEntryPoint` and `accessDeniedHandler` beans respectively.
163165

164166
But to make it work following needs to be done in application's Spring Security configuration.
165-
Refer to example [**`SecurityConfiguration`**](https://github.com/officiallysingh/problem-handler-web-demo/blob/main/src/main/java/com/ksoot/problem/demo/config/SecurityConfiguration.java)
167+
Refer to example [**`WebSecurityConfiguration`**](https://github.com/officiallysingh/problem-handler-web-demo/blob/main/src/main/java/com/ksoot/problem/demo/config/WebSecurityConfiguration.java)
166168
```java
167169
@Autowired
168170
private AuthenticationEntryPoint authenticationEntryPoint;
@@ -194,7 +196,7 @@ and [**`ProblemServerAccessDeniedHandler`**](src/main/java/com/ksoot/problem/spr
194196
are autoconfigured as `authenticationEntryPoint` and `accessDeniedHandler` beans respectively.
195197

196198
But to make it work following needs to be done in application Spring Security configuration.
197-
Refer to example [**`SecurityConfiguration`**](https://github.com/officiallysingh/problem-handler-webflux-demo/blob/main/src/main/java/com/ksoot/problem/demo/config/SecurityConfiguration.java)
199+
Refer to example [**`WebFluxSecurityConfiguration`**](https://github.com/officiallysingh/problem-handler-webflux-demo/blob/main/src/main/java/com/ksoot/problem/demo/config/WebFluxSecurityConfiguration.java)
198200
```java
199201
@Autowired
200202
private ServerAuthenticationEntryPoint authenticationEntryPoint;
@@ -322,7 +324,6 @@ problem.open-api.res-validation-enabled=false
322324
* `problem.open-api.req-validation-enabled`:- To enable or disable OpenAPI specification validation for request, default is `false`.
323325
* `problem.open-api.res-validation-enabled`:- To enable or disable OpenAPI specification validation for response, default is `false`.
324326

325-
326327
## Error Key
327328
The main concept behind specifying the error attributes in `properties` file is **Error key**, which is mandatory to be unique for each error scenario.
328329
**It is either derived or specified by application** while throwing exception and used to externalize the error attributes in `properties` file.
@@ -382,7 +383,6 @@ content-type: application/problem+xml
382383
* `code`:- Unique `String` code for this error, should not contain spaces or special characters except '_' and '-'.
383384
Used in `type`. Commonly used to set unique codes for different business error scenarios.
384385

385-
386386
## Message resolvers
387387
To know how to define the error attributes in properties file, enable debugging as follows.
388388
```properties

0 commit comments

Comments
 (0)