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:
|
||||
try:
|
||||
processor.do_engine_steps()
|
||||
except ApiError as e:
|
||||
raise e
|
||||
except Exception as e:
|
||||
ErrorHandlingService().handle_error(processor, e)
|
||||
task = processor.bpmn_process_instance.last_task
|
||||
|
|
|
@ -97,11 +97,18 @@ class CustomBpmnScriptEngine(PythonScriptEngine): # type: ignore
|
|||
try:
|
||||
return super()._evaluate(expression, context)
|
||||
except Exception as exception:
|
||||
raise WorkflowTaskExecException(
|
||||
task,
|
||||
"Error evaluating expression "
|
||||
"'%s', %s" % (expression, str(exception)),
|
||||
) from exception
|
||||
if task is None:
|
||||
raise ApiError(
|
||||
"error_evaluating_expression",
|
||||
"Error evaluating expression: "
|
||||
"'%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:
|
||||
"""Execute."""
|
||||
|
|
Loading…
Reference in New Issue