The celery documentation gives the following example for automatically retrying a task:
class BaseTaskWithRetry(Task): autoretry_for = (TypeError,) re