summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service
diff options
context:
space:
mode:
authorOleg Mitsura <oleg.mitsura@amdocs.com>2019-08-21 11:52:10 -0400
committerOleg Mitsura <oleg.mitsura@amdocs.com>2019-08-21 11:56:13 -0400
commitbf4ee7e749c34192feb10f6ac50e7eb2015a4e26 (patch)
tree0b77587adc02f0759eb2f5ede7d746bac009c67d /ms/controllerblueprints/modules/service
parent6fa3015125978bac1e255293cb98a472682f28db (diff)
ControllerBP logs errors
Issue-ID: CCSDK-1630 Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ie5e9ca67cc2e0aa9b1a36a7b13372687a94a71e7
Diffstat (limited to 'ms/controllerblueprints/modules/service')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExceptionHandler.kt (renamed from ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExeptionHandler.kt)16
1 files changed, 12 insertions, 4 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExeptionHandler.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExceptionHandler.kt
index de8ba93e3..5b92369f8 100644
--- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExeptionHandler.kt
+++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/controller/ControllerBlueprintExceptionHandler.kt
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.cds.controllerblueprints.core.data.ErrorCode
import org.onap.ccsdk.cds.controllerblueprints.service.common.ErrorMessage
+import org.slf4j.LoggerFactory
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.ExceptionHandler
@@ -32,19 +33,26 @@ import org.springframework.web.bind.annotation.ExceptionHandler
* @version 1.0
*/
@RestControllerAdvice("org.onap.ccsdk.cds.controllerblueprints")
-open class ControllerBlueprintExeptionHandler {
+open class ControllerBlueprintExceptionHandler {
+
+ companion object ControllerBlueprintExeptionHandler {
+ val LOG = LoggerFactory.getLogger(ControllerBlueprintExceptionHandler::class.java)
+ }
@ExceptionHandler
- fun ControllerBlueprintException(e: BluePrintException): ResponseEntity<ErrorMessage> {
+ fun ControllerBlueprintExceptionHandler(e: BluePrintException): ResponseEntity<ErrorMessage> {
var errorCode = ErrorCode.valueOf(e.code)
val errorMessage = ErrorMessage(errorCode?.message(e.message!!), errorCode?.value, "ControllerBluePrint_Error_Message")
+ LOG.error("Error: $errorCode ${e.message}")
return ResponseEntity(errorMessage, HttpStatus.resolve(errorCode!!.httpCode))
}
@ExceptionHandler
- fun ControllerBlueprintException(e: Exception): ResponseEntity<ErrorMessage> {
+ fun ControllerBlueprintExceptionHandler(e: Exception): ResponseEntity<ErrorMessage> {
var errorCode = ErrorCode.GENERIC_FAILURE
val errorMessage = ErrorMessage(errorCode?.message(e.message!!), errorCode?.value, "ControllerBluePrint_Error_Message")
+ LOG.error("Error: $errorCode ${e.message}")
return ResponseEntity(errorMessage, HttpStatus.resolve(errorCode!!.httpCode))
}
-} \ No newline at end of file
+}
+