Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1from openleadr.enums import STATUS_CODES
4class ProtocolError(Exception):
5 pass
8class FingerprintMismatch(Exception):
9 pass
12class HTTPError(Exception):
13 def __init__(self, status=500, description=None):
14 super().__init__()
15 self.response_code = status
16 self.response_description = description
19class OutOfSequenceError(ProtocolError):
20 def __init__(self, description='OUT OF SEQUENCE'):
21 super().__init__()
22 self.response_code = STATUS_CODES.OUT_OF_SEQUENCE
23 self.response_description = description
26class NotAllowedError(ProtocolError):
27 def __init__(self, description='NOT ALLOWED'):
28 super().__init__()
29 self.response_code = STATUS_CODES.NOT_ALLOWED
30 self.response_description = description
33class InvalidIdError(ProtocolError):
34 def __init__(self, description='INVALID ID'):
35 super().__init__()
36 self.response_code = STATUS_CODES.INVALID_ID
37 self.response_description = description
40class NotRecognizedError(ProtocolError):
41 def __init__(self, description='NOT RECOGNIZED'):
42 super().__init__()
43 self.response_code = STATUS_CODES.NOT_RECOGNIZED
44 self.response_description = description
47class InvalidDataError(ProtocolError):
48 def __init__(self, description='INVALID DATA'):
49 super().__init__()
50 self.response_code = STATUS_CODES.INVALID_DATA
51 self.response_description = description
54class ComplianceError(ProtocolError):
55 def __init__(self, description='COMPLIANCE ERROR'):
56 super().__init__()
57 self.response_code = STATUS_CODES.COMPLIANCE_ERROR
58 self.response_description = description
61class SignalNotSupportedError(ProtocolError):
62 def __init__(self, description='SIGNAL NOT SUPPORTED'):
63 super().__init__()
64 self.response_code = STATUS_CODES.SIGNAL_NOT_SUPPORTED
65 self.response_description = description
68class ReportNotSupportedError(ProtocolError):
69 def __init__(self, description='REPORT NOT SUPPORTED'):
70 super().__init__()
71 self.response_code = STATUS_CODES.REPORT_NOT_SUPPORTED
72 self.response_description = description
75class TargetMismatchError(ProtocolError):
76 def __init__(self, description='TARGET MISMATCH'):
77 super().__init__()
78 self.response_code = STATUS_CODES.TARGET_MISMATCH
79 self.response_description = description
82class NotRegisteredOrAuthorizedError(ProtocolError):
83 def __init__(self, description='NOT REGISTERED OR AUTHORIZED'):
84 super().__init__()
85 self.response_code = STATUS_CODES.NOT_REGISTERED_OR_AUTHORIZED
86 self.response_description = description
89class DeploymentError(ProtocolError):
90 def __init__(self, description='DEPLOYMENT ERROR OR OTHER ERROR'):
91 super().__init__()
92 self.response_code = STATUS_CODES.DEPLOYMENT_ERROR_OR_OTHER_ERROR
93 self.response_description = description
96# Flow-control based Exceptions
97class RequestReregistration(Exception):
98 def __init__(self, ven_id=None):
99 super().__init__()
100 self.ven_id = ven_id
103class SendEmptyHTTPResponse(Exception):
104 pass