diff options
author | KAPIL SINGAL <ks220y@att.com> | 2019-12-26 17:07:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-26 17:07:24 +0000 |
commit | c66d0094f624dcf97e08a5fc9a2a5e01c90bb772 (patch) | |
tree | 6fa773f6e8c94b0bfa594ed621291a3ae7dc603e /ms | |
parent | 9139997c4ab71e5134bb737a7c1ea6a8f105dfa3 (diff) | |
parent | ae052d5d84e06dbfe8fb951ce16387bc2c02bdc0 (diff) |
Merge "add logging to value not found from properties"
Diffstat (limited to 'ms')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt index 76b37a5b4..95b2c0154 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt @@ -17,7 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.core +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.cds.controllerblueprints.core.logger import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired @@ -60,9 +62,16 @@ open class BluePrintPropertyConfiguration { @Service open class BluePrintPropertiesService(private var bluePrintPropertyBinder: Binder) { + private val log = logger(BluePrintPropertiesService::class) fun <T> propertyBeanType(prefix: String, type: Class<T>): T { - return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get() + return try { + bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get() + } catch (e: NoSuchElementException) { + val errMsg = "Error: missing property \"$prefix\"... Check the application.properties file." + log.error(errMsg) + throw BluePrintProcessorException(e, errMsg) + } } } |