task_trace was a little mixed up in the errors.

This commit is contained in:
Dan 2022-03-16 10:18:50 -04:00
parent 791ab20f8c
commit 1506952df7
2 changed files with 8 additions and 2 deletions

View File

@ -160,9 +160,13 @@ def validate_all(study_id, category=None, spec_id=None):
print(f"Skipping {spec.id} in category {spec.category.display_name}, it is disabled for this study.")
else:
print(f"API Error {e.code}, validate workflow {spec.id} in Category {spec.category.display_name}. {e.message}")
for t in e.task_trace:
print(f"---> {t}")
continue
except WorkflowTaskExecException as e:
print(f"Workflow Error, {e}, in Task {e.task.name} validate workflow {spec.id} in Category {spec.category.display_name}")
for t in e.task_trace:
print(f"---> {t}")
continue
except Exception as e:
print(f"Unexpected Error ({e.__class__.__name__}), {e} validate workflow {spec.id} in Category {spec.category.display_name}")

View File

@ -15,9 +15,11 @@ class ApiError(Exception):
def __init__(self, code, message, status_code=400,
file_name="", task_id="", task_name="", tag="",
task_data=None, error_type="", error_line="", line_number=0, offset=0,
task_trace=[]):
task_trace=None):
if task_data is None:
task_data = {}
if task_trace is None:
task_trace = {}
self.status_code = status_code
self.code = code # a short consistent string describing the error.
self.message = message # A detailed message that provides more information.
@ -30,7 +32,7 @@ class ApiError(Exception):
self.offset = offset
self.error_type = error_type
self.error_line = error_line
self.task_stack = task_trace
self.trask_trace = task_trace
try:
user = g.user.uid