blob: d6ae56d0259b9161fbdd41ebaac96b8f4e6cc7e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
## How to use library
##### 1. Set Error Catalog service type (Database or properties file service) in application.properties file
```
##### Error Managements #####
## For database service type ##
# error.catalog.type=DB
## For database service type ##
# error.catalog.type=properties
error.catalog.applicationId=cds
error.catalog.type=properties
```
##### 2. Generate exception
- HTTP Error Exception
```
errorCatalogException: ErrorCatalogException = httpProcessorException(ErrorCatalogCodes.ERROR_TYPE,
"Error message here...")
```
- GRPC Error Exception
```
errorCatalogException: ErrorCatalogException = grpcProcessorException(ErrorCatalogCodes.ERROR_TYPE,
"Error message here...")
```
##### 3. Update an existing exception
```
e = errorCatalogException.code(500)
e = errorCatalogException.action("message")
...
```
##### 4. Add a HTTP REST Exception handler
|