summaryrefslogtreecommitdiff
path: root/django/tasks/exceptions.py
diff options
context:
space:
mode:
authorJake Howard <git@theorangeone.net>2025-07-17 12:51:09 +0100
committernessita <124304+nessita@users.noreply.github.com>2025-09-16 17:28:32 -0300
commit4289966d1b8e848e5e460b7c782dac009d746b20 (patch)
treeef1d61a33562579d985c762036db5f7aa01406fc /django/tasks/exceptions.py
parent218f69f05eb51da1ea17d62a914a67ceff5bfd55 (diff)
Fixed #35859 -- Added background Tasks framework interface.
This work implements what was defined in DEP 14 (https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst). Thanks to Raphael Gaschignard, Eric Holscher, Ran Benita, Sarah Boyce, Jacob Walls, and Natalia Bidart for the reviews.
Diffstat (limited to 'django/tasks/exceptions.py')
-rw-r--r--django/tasks/exceptions.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/django/tasks/exceptions.py b/django/tasks/exceptions.py
new file mode 100644
index 0000000000..91bd8f4cd5
--- /dev/null
+++ b/django/tasks/exceptions.py
@@ -0,0 +1,21 @@
+from django.core.exceptions import ImproperlyConfigured
+
+
+class TaskException(Exception):
+ """Base class for task-related exceptions. Do not raise directly."""
+
+
+class InvalidTask(TaskException):
+ """The provided Task is invalid."""
+
+
+class InvalidTaskBackend(ImproperlyConfigured):
+ """The provided Task backend is invalid."""
+
+
+class TaskResultDoesNotExist(TaskException):
+ """The requested TaskResult does not exist."""
+
+
+class TaskResultMismatch(TaskException):
+ """The requested TaskResult is invalid."""