WorkflowProcessor handles this error

This commit is contained in:
mike cullerton 2021-06-15 11:12:50 -04:00
parent addf1cab5b
commit 02949dc6e2
1 changed files with 2 additions and 7 deletions

View File

@ -25,13 +25,8 @@ class ResetWorkflow(Script):
workflow_spec_id=workflow_spec.id,
study_id=study_id).first()
if workflow_model:
try:
workflow_processor = WorkflowProcessor.reset(workflow_model, clear_data=False, delete_files=False)
except Exception as e:
raise ApiError(code='unknown_error',
message=f'An unknown error occurred: {e}')
else:
return True
workflow_processor = WorkflowProcessor.reset(workflow_model, clear_data=False, delete_files=False)
return workflow_processor
else:
raise ApiError(code='missing_workflow_model',
message=f'No WorkflowModel returned. \