diff options
author | Brinda Santh <bs2796@att.com> | 2020-03-06 13:04:37 -0500 |
---|---|---|
committer | Steve Siani <alphonse.steve.siani.djissitchi@ibm.com> | 2020-04-06 11:59:21 -0400 |
commit | 20dcdbc1384a1173d7e63dd666d530908c845a1e (patch) | |
tree | 411fc65137ff224f1ca8683495f06604f72b9092 /ms/blueprintsprocessor/functions/python-executor | |
parent | 4dccd00d6b1399596ed6f1e0c7f08cdb98cbec4f (diff) |
Refactoring BP Code with ErrorCatalog
Issue-ID: CCSDK-2124
Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Change-Id: Ief468a56f9e7b3ef86c357965aa7b15f0a4cfa22
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor')
-rw-r--r-- | ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt index 93fe2b1f5..3d2f10ec0 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/scripts/BlueprintPythonHost.kt @@ -15,7 +15,9 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.updateErrorMessage import org.python.core.PyObject import org.python.util.PythonInterpreter @@ -42,6 +44,10 @@ open class BlueprintPythonHost(private val bluePrintPython: BluePrintPython) { bluePrintPython.moduleName = "Blueprint Python Script [Class Name = $interfaceName]" try { return blueprintPythonInterpreterProxy.getPythonInstance(properties) + } catch (e: BluePrintProcessorException) { + val errorMsg = "Failed to get python instance." + throw e.updateErrorMessage(ExecutionServiceDomains.PYTHON_EXECUTOR, errorMsg, + "Error in environment properties") } catch (e: Exception) { throw BluePrintProcessorException("Failed to execute Jython component $e", e) } |