Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions alcf/globus/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ def get_task_status(user: account_models.User, task_id: str):
# Failed
if result["error"]:
status = task_models.TaskStatus.failed.value
result = result["error"]
result = {
"error": result["error"]
}

# Completed
else:
Expand All @@ -228,7 +230,9 @@ def get_task_status(user: account_models.User, task_id: str):
# Failed if an error occured outside of the function execution
else:
status = task_models.TaskStatus.failed.value
result = "?????"
result = {
"error": "Unexpected error outside of the function execution."
}

# Return the status and result (if any)
return status, result
Expand Down
2 changes: 2 additions & 0 deletions alcf/task/alcf_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ async def _update_iri_task(self, user: account_models.User, iri_task: task_model
result_for_db = json.dumps(result)
else:
result_for_db = json.dumps(result.model_dump())
elif status == task_models.TaskStatus.failed.value:
result_for_db = json.dumps(result)
except Exception as e:
raise HTTPException(
status_code=HTTP_500_INTERNAL_SERVER_ERROR,
Expand Down
Loading