summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/python-executor
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2020-03-06 13:04:37 -0500
committerDan Timoney <dtimoney@att.com>2020-04-08 12:19:51 -0400
commit4384dfcb4c2147f9c2ae0142a4f01dd94c347c50 (patch)
tree57c5eafb81b00c6fc38ef2eb7eda18db7cce392b /ms/blueprintsprocessor/functions/python-executor
parent01d045f109c24749c9ed46f4008f496e4bf62bcb (diff)
Refactoring BP Code with ErrorCatalog
Issue-ID: CCSDK-2124 Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com> Change-Id: Ief468a56f9e7b3ef86c357965aa7b15f0a4cfa22 Signed-off-by: Dan Timoney <dtimoney@att.com>
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.kt6
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)
}