3 ##### 1. Set Error Catalog service type (Database or properties file service) in application.properties file
6 ##### Error Managements #####
7 ## For database service type ##
8 # error.catalog.type=DB
9 ## For database service type ##
10 # error.catalog.type=properties
11 error.catalog.applicationId=cds
12 error.catalog.type=properties
13 error.catalog.errorDefinitionDir=/opt/app/onap/config
16 ##### 2. Generate exception
18 - HTTP Error Exception
20 errorCatalogException: ErrorCatalogException = httpProcessorException(ErrorCatalogCodes.ERROR_TYPE,
21 "Error message here...")
24 - GRPC Error Exception
26 errorCatalogException: ErrorCatalogException = grpcProcessorException(ErrorCatalogCodes.ERROR_TYPE,
27 "Error message here...")
30 ##### 3. Update an existing exception
32 e = errorCatalogException.code(500)
33 e = errorCatalogException.action("message")
37 ##### 4. Add a HTTP REST Exception handler
38 @RestControllerAdvice("domain.here")
39 open class ExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
40 ErrorCatalogExceptionHandler(errorCatalogService)