-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathexceptions.py
More file actions
50 lines (35 loc) · 1.24 KB
/
Copy pathexceptions.py
File metadata and controls
50 lines (35 loc) · 1.24 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
from socketdev.exceptions import APIFailure as SdkAPIFailure
__all__ = [
"APIFailure",
"APIKeyMissing",
"APIAccessDenied",
"APIInsufficientQuota",
"APIResourceNotFound",
"APICloudflareError"
]
class APICloudflareError(Exception):
"""Raised when there is an error using the API related to cloudflare"""
pass
class APIKeyMissing(Exception):
"""Raised when the api key is not passed and the headers are empty"""
pass
class APIFailure(SdkAPIFailure):
"""Raised when there is an error using the API.
Subclasses the SDK's exception of the same name so a handler written against
either one catches both. A separate Exception subclass would bypass an
``except APIFailure`` importing the SDK's -- which every handler in
socketsecurity.core does -- and would not carry the SDK class's status code.
"""
pass
class APIAccessDenied(Exception):
"""Raised when access is denied to the API"""
pass
class APIInsufficientQuota(Exception):
"""Raised when access is denied to the API"""
pass
class APIResourceNotFound(Exception):
"""Raised when access is denied to the API"""
pass
class RequestTimeoutExceeded(Exception):
"""Raised when access is denied to the API"""
pass