-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathexceptions.py
More file actions
236 lines (170 loc) · 5.97 KB
/
Copy pathexceptions.py
File metadata and controls
236 lines (170 loc) · 5.97 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# -*- coding: utf-8 -*-
class CryptoError(Exception):
pass
class ConfigZoneLockedError(CryptoError):
def __init__(self, *args):
super().__init__("Config Zone Locked", *args)
class DataZoneLockedError(CryptoError):
def __init__(self, *args):
super().__init__("Configuration Enabled", *args)
class WakeFailedError(CryptoError):
def __init__(self, *args):
super().__init__("Device Wake failed", *args)
class CheckmacVerifyFailedError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status byte indicates CheckMac/Verify failure "
"(status byte = 0x01)",
*args
)
class ParseError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status byte indicates parsing error "
"(status byte = 0x03)",
*args
)
class WatchDogAboutToExpireError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status indicate insufficient time to execute the given "
"commmand begore watchdog timer will expire (status byte = 0xEE)",
*args
)
class CrcError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status byte indicates CRC error (status byte = 0xFF)",
*args
)
class StatusUnknownError(CryptoError):
def __init__(self, *args):
super().__init__("Response status byte is unknown", *args)
class EccFaultError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status byte is ECC fault (status byte = 0x05)",
*args
)
class SelfTestError(CryptoError):
def __init__(self, *args):
super().__init__(
"response status byte is Self Test Error, "
"chip in failure mode (status byte = 0x07)",
*args
)
class HealthTestError(CryptoError):
def __init__(self, *args):
super().__init__("random number generator health test error", *args)
class FunctionError(CryptoError):
def __init__(self, *args):
super().__init__(
"Function could not execute due to incorrect condition / state.",
*args
)
class GenericError(CryptoError):
def __init__(self, *args):
super().__init__("unspecified error", *args)
class BadArgumentError(CryptoError):
def __init__(self, *args):
super().__init__(
"bad argument (out of range, null pointer, etc.)",
*args
)
class InvalidIdentifierError(CryptoError):
def __init__(self, *args):
super().__init__("invalid device id, id not set", *args)
class InvalidSizeError(CryptoError):
def __init__(self, *args):
super().__init__(
"Count value is out of range or greater than buffer size.",
*args
)
class BadCrcError(CryptoError):
def __init__(self, *args):
super().__init__("incorrect CRC received", *args)
class ReceiveError(CryptoError):
def __init__(self, *args):
super().__init__(
"Timed out while waiting for response. "
"Number of bytes received is > 0.",
*args
)
class NoResponseError(CryptoError):
def __init__(self, *args):
super().__init__(
"error while the Command layer is polling for a command response.",
*args
)
class ResyncWithWakeupError(CryptoError):
def __init__(self, *args):
super().__init__(
"Re-synchronization succeeded, but only after generating a Wake-up",
*args
)
class ParityError(CryptoError):
def __init__(self, *args):
super().__init__("for protocols needing parity", *args)
class TransmissionTimeoutError(CryptoError):
def __init__(self, *args):
super().__init__(
"for Microchip PHY protocol, "
"timeout on transmission waiting for master",
*args
)
class ReceiveTimeoutError(CryptoError):
def __init__(self, *args):
super().__init__(
"for Microchip PHY protocol, timeout on receipt waiting for master",
*args
)
class CommunicationError(CryptoError):
def __init__(self, *args):
super().__init__(
"Communication with device failed. "
"Same as in hardware dependent modules.",
*args
)
class TimeOutError(CryptoError):
def __init__(self, *args):
super().__init__(
"Timed out while waiting for response. "
"Number of bytes received is 0.",
*args
)
class BadOpcodeError(CryptoError):
def __init__(self, *args):
super().__init__("Opcode is not supported by the device",
*args)
class ExecutionError(CryptoError):
def __init__(self, *args):
super().__init__(
"chip was in a state where it could not execute the command, response "
"status byte indicates command execution error (status byte = 0x0F)",
*args
)
class UnimplementedError(CryptoError):
def __init__(self, *args):
super().__init__(
"Function or some element of it hasn't been implemented yet",
*args
)
class AssertionFailure(CryptoError):
def __init__(self, *args):
super().__init__("Code failed run-time consistency check", *args)
class TransmissionError(CryptoError):
def __init__(self, *args):
super().__init__("Failed to write", *args)
class ZoneNotLockedError(CryptoError):
def __init__(self, *args):
super().__init__("required zone was not locked", *args)
class NoDevicesFoundError(CryptoError):
def __init__(self, *args):
super().__init__(
"For protocols that support device discovery (kit protocol), "
"no devices were found",
*args
)
class UnsupportedDeviceError(CryptoError):
def __init__(self, *args):
super().__init__(*args)