-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathexceptions.py
More file actions
147 lines (76 loc) · 4.1 KB
/
exceptions.py
File metadata and controls
147 lines (76 loc) · 4.1 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
"""Errors defined for Overkiz API and its integrations."""
class BaseOverkizError(Exception):
"""Base error for Overkiz errors."""
class OverkizError(BaseOverkizError):
"""Raised when an undefined error occurs while communicating with the Overkiz API."""
class BadCredentialsError(BaseOverkizError):
"""Raised when invalid credentials are provided."""
class InvalidCommandError(BaseOverkizError):
"""Raised when an invalid command is provided."""
class DuplicateActionOnDeviceError(BaseOverkizError):
"""Raised when another action already exists for the same device."""
class ActionGroupSetupNotFoundError(BaseOverkizError):
"""Raised when an action group setup cannot be determined for a gateway."""
class NoSuchResourceError(BaseOverkizError):
"""Raised when an invalid API call is made."""
class ResourceAccessDeniedError(BaseOverkizError):
"""Raised when the API returns a RESOURCE_ACCESS_DENIED error."""
class NotAuthenticatedError(ResourceAccessDeniedError):
"""Raised when the user is not authenticated."""
class TooManyExecutionsError(BaseOverkizError):
"""Raised when too many executions are requested."""
class ExecutionQueueFullError(BaseOverkizError):
"""Raised when the execution queue is full."""
class TooManyRequestsError(BaseOverkizError):
"""Raised when too many requests are made."""
class TooManyConcurrentRequestsError(BaseOverkizError):
"""Raised when too many concurrent requests are made."""
class ServiceUnavailableError(BaseOverkizError):
"""Raised when the service is unavailable."""
class MaintenanceError(ServiceUnavailableError):
"""Raised when the service is under maintenance."""
class MissingAPIKeyError(BaseOverkizError):
"""Raised when the API key is missing."""
class MissingAuthorizationTokenError(ResourceAccessDeniedError):
"""Raised when the authorization token is missing."""
class InvalidEventListenerIdError(BaseOverkizError):
"""Raised when an invalid event listener ID is provided."""
class NoRegisteredEventListenerError(BaseOverkizError):
"""Raised when no event listener is registered."""
class SessionAndBearerInSameRequestError(BaseOverkizError):
"""Raised when both session and bearer are provided in the same request."""
class TooManyAttemptsBannedError(BaseOverkizError):
"""Raised when too many attempts are made and the user is (temporarily) banned."""
class InvalidTokenError(BaseOverkizError):
"""Raised when an invalid token is provided."""
class NoSuchTokenError(BaseOverkizError):
"""Raised when no such token exists."""
class UnknownUserError(BaseOverkizError):
"""Raised when an unknown user is provided."""
class NoSuchDeviceError(BaseOverkizError):
"""Raised when the requested device does not exist."""
class NoSuchActionGroupError(BaseOverkizError):
"""Raised when the requested action group does not exist."""
class UnknownObjectError(BaseOverkizError):
"""Raised when an unknown object is provided."""
class AccessDeniedToGatewayError(ResourceAccessDeniedError):
"""Raised when access is denied to the gateway.
This often happens when the user is not the owner of the gateway.
"""
class ApplicationNotAllowedError(ResourceAccessDeniedError):
"""Raised when the setup cannot be accessed through the application."""
# Nexity
class NexityBadCredentialsError(BadCredentialsError):
"""Raised when invalid credentials are provided to Nexity authentication API."""
class NexityServiceError(BaseOverkizError):
"""Raised when an error occurs while communicating with the Nexity API."""
# CozyTouch
class CozyTouchBadCredentialsError(BadCredentialsError):
"""Raised when invalid credentials are provided to CozyTouch authentication API."""
class CozyTouchServiceError(BaseOverkizError):
"""Raised when an error occurs while communicating with the CozyTouch API."""
# Somfy
class SomfyBadCredentialsError(BadCredentialsError):
"""Raised when invalid credentials are provided to Somfy authentication API."""
class SomfyServiceError(BaseOverkizError):
"""Raised when an error occurs while communicating with the Somfy API."""