diff options
author | Sunil Shetye | 2025-05-23 12:54:35 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-05-23 12:54:35 +0530 |
commit | 4f621331f7a56a83ab0cd501acd4a4cff811b68a (patch) | |
tree | 480db91463fd6a8a402f7ef0e183175230252ac0 | |
parent | 67452d9995fbde957310931c6b850787ae06e6b8 (diff) | |
download | Common-Interface-Project-4f621331f7a56a83ab0cd501acd4a4cff811b68a.tar.gz Common-Interface-Project-4f621331f7a56a83ab0cd501acd4a4cff811b68a.tar.bz2 Common-Interface-Project-4f621331f7a56a83ab0cd501acd4a4cff811b68a.zip |
remove exception class from details
-rw-r--r-- | blocks/simulationAPI/views.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/blocks/simulationAPI/views.py b/blocks/simulationAPI/views.py index 279b9a5e..63f819a2 100644 --- a/blocks/simulationAPI/views.py +++ b/blocks/simulationAPI/views.py @@ -172,8 +172,13 @@ class CeleryResultView(APIView): response_data = { 'task_id': task_id, 'state': celery_result.state, - 'details': str(celery_result.info) } + + # If the task failed, clean up the error message + e = celery_result.info + details = str(e) + response_data['details'] = details.split(': ', 1)[-1] if celery_result.failed() and isinstance(e, BaseException) else details + return Response(response_data) |