File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ from typing import Optional
2+
13from izulu import root
24
35
46class TaskiqError (root .Error ):
57 """Base exception for all errors."""
68
79 __template__ = "Exception occurred: {description}"
8- description : str
10+ description : Optional [ str ] = None
911
1012
1113class TaskiqResultTimeoutError (TaskiqError ):
1214 """Waiting for task results has timed out."""
1315
1416 __template__ = "Waiting for task results has timed out, timeout={timeout}"
15- timeout : float
17+ timeout : Optional [ float ] = None
1618
1719
1820class BrokerError (TaskiqError ):
@@ -54,7 +56,8 @@ class ResultIsReadyError(ResultBackendError):
5456class SecurityError (TaskiqError ):
5557 """Security related exception."""
5658
57- __template__ = "Base exception for all security errors"
59+ __template__ = "Security exception occurred: {description}"
60+ description : str
5861
5962
6063class NoResultError (TaskiqError ):
Original file line number Diff line number Diff line change @@ -378,7 +378,10 @@ def exception_to_python(
378378 if not isinstance (cls , type ) or not issubclass (cls , BaseException ):
379379 fake_exc_type = exc_type if exc_module is None else f"{ exc_module } .{ exc_type } "
380380 raise taskiq .exceptions .SecurityError (
381- f"Expected an exception class, got { fake_exc_type } with payload { exc_msg } " ,
381+ description = (
382+ f"Expected an exception class, "
383+ f"got { fake_exc_type } with payload { exc_msg } "
384+ ),
382385 )
383386
384387 # XXX: Without verifying `cls` is actually an exception class,
You can’t perform that action at this time.
0 commit comments