display the evaluation error when evaluating an expression instead of the NoneType error w/ burnettk
This commit is contained in:
parent
5524062702
commit
59c10c1778
|
@ -330,6 +330,8 @@ def process_instance_run(
|
||||||
if do_engine_steps:
|
if do_engine_steps:
|
||||||
try:
|
try:
|
||||||
processor.do_engine_steps()
|
processor.do_engine_steps()
|
||||||
|
except ApiError as e:
|
||||||
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
ErrorHandlingService().handle_error(processor, e)
|
ErrorHandlingService().handle_error(processor, e)
|
||||||
task = processor.bpmn_process_instance.last_task
|
task = processor.bpmn_process_instance.last_task
|
||||||
|
|
|
@ -97,11 +97,18 @@ class CustomBpmnScriptEngine(PythonScriptEngine): # type: ignore
|
||||||
try:
|
try:
|
||||||
return super()._evaluate(expression, context)
|
return super()._evaluate(expression, context)
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
raise WorkflowTaskExecException(
|
if task is None:
|
||||||
task,
|
raise ApiError(
|
||||||
"Error evaluating expression "
|
"error_evaluating_expression",
|
||||||
"'%s', %s" % (expression, str(exception)),
|
"Error evaluating expression: "
|
||||||
) from exception
|
"'%s', exception: %s" % (expression, str(exception)),
|
||||||
|
) from exception
|
||||||
|
else:
|
||||||
|
raise WorkflowTaskExecException(
|
||||||
|
task,
|
||||||
|
"Error evaluating expression "
|
||||||
|
"'%s', %s" % (expression, str(exception)),
|
||||||
|
) from exception
|
||||||
|
|
||||||
def execute(self, task: SpiffTask, script: str) -> None:
|
def execute(self, task: SpiffTask, script: str) -> None:
|
||||||
"""Execute."""
|
"""Execute."""
|
||||||
|
|
Loading…
Reference in New Issue