Merge commit '98b76370b1b64eafc354c6a0283f2c9977b5c91c'

This commit is contained in:
burnettk 2022-10-26 16:24:47 -04:00
commit 1413325a29
1 changed files with 3 additions and 4 deletions

View File

@ -144,7 +144,7 @@ class PythonScriptEngine(object):
self.check_for_overwrite(task, external_methods or {}) self.check_for_overwrite(task, external_methods or {})
self._execute(script, task.data, external_methods or {}) self._execute(script, task.data, external_methods or {})
except Exception as err: except Exception as err:
wte = self.create_task_exec_exception(task, err) wte = self.create_task_exec_exception(task, script, err)
self.error_tasks[task.id] = wte self.error_tasks[task.id] = wte
raise wte raise wte
@ -153,7 +153,7 @@ class PythonScriptEngine(object):
tasks.""" tasks."""
raise NotImplementedError("To call external services override the script engine and implement `call_service`.") raise NotImplementedError("To call external services override the script engine and implement `call_service`.")
def create_task_exec_exception(self, task, err): def create_task_exec_exception(self, task, script, err):
if isinstance(err, WorkflowTaskExecException): if isinstance(err, WorkflowTaskExecException):
return err return err
@ -170,8 +170,7 @@ class PythonScriptEngine(object):
for frame_summary in traceback.extract_tb(tb): for frame_summary in traceback.extract_tb(tb):
if frame_summary.filename == '<string>': if frame_summary.filename == '<string>':
line_number = frame_summary.lineno line_number = frame_summary.lineno
error_line = task.task_spec.script.splitlines()[ error_line = script.splitlines()[line_number - 1]
line_number - 1]
return WorkflowTaskExecException(task, detail, err, line_number, return WorkflowTaskExecException(task, detail, err, line_number,
error_line) error_line)