django-background-tasks/background_task/exceptions.py
Ariki e73fc17802 Add InvalidTaskError exception class. (#133)
The idea is to raise InvalidTaskError from a task in cases when the task

 must not be rescheduled.
2018-04-10 17:44:30 +02:00

16 lines
324 B
Python

# -*- coding: utf-8 -*-
class BackgroundTaskError(Exception):
def __init__(self, message, errors=None):
super(BackgroundTaskError, self).__init__(message)
self.errors = errors
class InvalidTaskError(BackgroundTaskError):
"""
The task will not be rescheduled if it fails with this error
"""
pass