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
No related branches found
No related tags found
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.
Finish editing this message first!
Please register or to comment