summaryrefslogtreecommitdiffstats
path: root/ms/error-catalog
diff options
context:
space:
mode:
authorSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>2020-03-14 12:10:35 -0400
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>2020-03-16 12:45:50 -0400
commitf57a6381ba0240a4c5de3b4a9dbe7573f4c3775e (patch)
treea795ee0bed7f9b76efac568f4cde2ffe84ab3160 /ms/error-catalog
parente800b146c0301076960ccdcb67f2b6965e26741d (diff)
Update application properties for ErrorCatalog
Issue-ID: CCSDK-2174 Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com> Change-Id: I8d8de812bb560ef2c01bc3bee8dd17f9d6ed1099
Diffstat (limited to 'ms/error-catalog')
-rwxr-xr-xms/error-catalog/README.md6
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt2
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt2
3 files changed, 7 insertions, 3 deletions
diff --git a/ms/error-catalog/README.md b/ms/error-catalog/README.md
index d6ae56d02..1df859574 100755
--- a/ms/error-catalog/README.md
+++ b/ms/error-catalog/README.md
@@ -10,6 +10,7 @@
# error.catalog.type=properties
error.catalog.applicationId=cds
error.catalog.type=properties
+error.catalog.errorDefinitionDir=/opt/app/onap/config
```
##### 2. Generate exception
@@ -33,4 +34,7 @@ e = errorCatalogException.action("message")
...
```
-##### 4. Add a HTTP REST Exception handler \ No newline at end of file
+##### 4. Add a HTTP REST Exception handler
+@RestControllerAdvice("domain.here")
+open class ExceptionHandler(private val errorCatalogService: ErrorCatalogService) :
+ ErrorCatalogExceptionHandler(errorCatalogService) \ No newline at end of file
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt
index 8f2440e34..a73401724 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt
@@ -30,5 +30,5 @@ open class ErrorCatalogConfiguration
open class ErrorCatalogProperties {
lateinit var type: String
lateinit var applicationId: String
- var defaultDirectory: String = ""
+ var errorDefinitionDir: String = ""
}
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt
index d1af5fe55..b8a649eb0 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt
@@ -102,7 +102,7 @@ open class ErrorCatalogLoadPropertyService(private var errorCatalogProperties: E
ErrorCatalogLoadService {
private val propertyFileName = ErrorMessageLibConstants.ERROR_CATALOG_PROPERTIES_FILENAME
- private var propertyFileBaseDirectory = Paths.get(errorCatalogProperties.defaultDirectory)
+ private var propertyFileBaseDirectory = Paths.get(errorCatalogProperties.errorDefinitionDir)
private var propertyFilePath = propertyFileBaseDirectory.resolve(propertyFileName)
private var log = logger(ErrorCatalogLoadPropertyService::class)