/
exceptions.py
103 lines (70 loc) · 2.7 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
class PrefectSignal(BaseException):
"""
Signals inherit from `BaseException` and will not be caught by normal error
handling. This allows us to bypass typical error handling by raising signals.
See `prefect.engine.signals` for additional subclasses used for raising state
transitions.
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class VersionLockMismatchSignal(PrefectSignal):
"""
Raised when version locking is enabled and a task run state version sent to Cloud
does not match the version expected by the server.
This is not backwards compatible with `prefect.utilities.exceptions.VersionLockError`
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class TaskTimeoutSignal(PrefectSignal):
"""
Raised when a task reaches a timeout limit
This is not backwards compatible with `prefect.utilities.exceptions.TaskTimeoutError`
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class PrefectException(Exception):
"""
The base exception type for all Prefect related exceptions
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class ClientError(PrefectException):
"""
Raised when there is error in Prefect Client <-> Server communication
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class ObjectNotFoundError(ClientError):
"""
Raised when an object is not found on the Server
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class AuthorizationError(ClientError):
"""
Raised when there is an issue authorizing with Prefect Cloud
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)
class FlowStorageError(PrefectException):
"""
Raised when there is an error loading a flow from storage
Args:
- message: A message with additional information about the error
"""
def __init__(self, message: str = "") -> None:
super().__init__(message)