Skip to content
Snippets Groups Projects
Commit 11296ab2 authored by Erik Reid's avatar Erik Reid
Browse files

construct object if task result is an Exception

parent 88448fd3
Branches
Tags
No related merge requests found
......@@ -416,5 +416,13 @@ def check_task_status(task_id):
'success': r.status == states.SUCCESS,
}
if r.result:
result['result'] = r.result
# TODO: only discovered this case by testing, is this the only one?
# ... otherwise need to pre-test json serialization
if isinstance(r.result, Exception):
result['result'] = {
'error type': type(r.result).__name__,
'message': str(r.result)
}
else:
result['result'] = r.result
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment