Python 当芹菜任务失败时,向on_failure发送自定义参数

Python 当芹菜任务失败时,向on_failure发送自定义参数,python,python-3.x,celery,scheduled-tasks,Python,Python 3.x,Celery,Scheduled Tasks,是否有方法获取引发异常的任务的名称,以及是否有方法将自定义参数发送到on_failure() class TaskBase(Task): def on_failure(self, exc, task_id, args, kwargs, einfo): print(the task name where exception was raise is {self.name}) print(self.DATA)

是否有方法获取引发异常的任务的名称,以及是否有方法将自定义参数发送到on_failure()

    class TaskBase(Task):
         def on_failure(self, exc, task_id, args, kwargs, einfo):
            print(the task name where exception was raise is {self.name})
            print(self.DATA)
             
    @celery.task(name="hello", base=TaskBase)
    def backup_cluster():
         DATA = query_from_db()
         raise exception