You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Django with Celery and django-celery-results. When a task fails, django-celery-results seems to store information about the exception that caused the failure. I would like to enhance the result field of the TaskResult model when a task fails by adding custom keys alongside the default exception details which I need to include for additional bookkeeping data. How would I go about doing this?
Current Result:
{
"exc_type": "ValueError",
"exc_message": ["this is a custom raised exception...."],
"exc_module": "builtins"
}
Expected Result:
{
"exc_type": "ValueError",
"exc_message": ["this is a custom raised exception...."],
"exc_module": "builtins",
"custom_field_1": "value_1",
"custom_field_2": "value_2"
}
The text was updated successfully, but these errors were encountered:
oahshtsua
changed the title
Add Custom Fields to result Field of TaskResult on Failure.
Add custom fields to result field of TaskResult on Failure.
Sep 24, 2024
I'm using Django with Celery and
django-celery-results
. When a task fails,django-celery-results
seems to store information about the exception that caused the failure. I would like to enhance the result field of theTaskResult
model when a task fails by adding custom keys alongside the default exception details which I need to include for additional bookkeeping data. How would I go about doing this?Current Result:
Expected Result:
Environment:
The text was updated successfully, but these errors were encountered: