1
- class TaskiqError (Exception ):
1
+ from izulu import root
2
+
3
+ class TaskiqError (root .Error ):
2
4
"""Base exception for all errors."""
3
5
6
+ __template__ = "Base exception for all errors"
7
+
4
8
5
9
class TaskiqResultTimeoutError (TaskiqError ):
6
10
"""Waiting for task results has timed out."""
7
11
12
+ __template__ = "Waiting for task results has timed out, timeout={timeout}"
13
+ timeout : float
14
+
8
15
9
16
class BrokerError (TaskiqError ):
10
17
"""Base class for all broker errors."""
11
18
19
+ __template__ = "Base exception for all broker errors"
20
+
12
21
13
22
class SendTaskError (BrokerError ):
14
23
"""Error if the broker was unable to send the task to the queue."""
15
24
25
+ __template__ = "Cannot send task to the queue"
26
+
16
27
17
28
class ResultBackendError (TaskiqError ):
18
29
"""Base class for all ResultBackend errors."""
19
30
31
+ __template__ = "Base exception for all result backend errors"
32
+
20
33
21
34
class ResultGetError (ResultBackendError ):
22
35
"""Error if ResultBackend was unable to get result."""
23
36
37
+ __template__ = "Cannot get result for the task"
38
+
24
39
25
40
class ResultSetError (ResultBackendError ):
26
41
"""Error if ResultBackend was unable to set result."""
27
42
43
+ __template__ = "Cannot set result for the task"
44
+
28
45
29
46
class ResultIsReadyError (ResultBackendError ):
30
47
"""Error if ResultBackend was unable to find out if the task is ready."""
31
48
49
+ __template__ = "Cannot find out if the task is ready"
50
+
32
51
33
52
class SecurityError (TaskiqError ):
34
53
"""Security related exception."""
35
54
55
+ __template__ = "Base exception for all security errors"
56
+
36
57
37
58
class NoResultError (TaskiqError ):
38
59
"""Error if user does not want to set result."""
@@ -41,6 +62,10 @@ class NoResultError(TaskiqError):
41
62
class TaskRejectedError (TaskiqError ):
42
63
"""Task was rejected."""
43
64
65
+ __template__ = "Task was rejected"
66
+
44
67
45
68
class ScheduledTaskCancelledError (TaskiqError ):
46
69
"""Scheduled task was cancelled and not sent to the queue."""
70
+
71
+ __template__ = "Cannot send scheduled task to the queue."
0 commit comments