-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathexceptions.py
More file actions
136 lines (70 loc) · 4.15 KB
/
exceptions.py
File metadata and controls
136 lines (70 loc) · 4.15 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
"""Exceptions defined for Overkiz API and its integrations."""
class BaseOverkizException(Exception):
"""Base exception for Overkiz errors."""
class OverkizException(BaseOverkizException):
"""Raised when an undefined error occurs while communicating with the Overkiz API."""
class BadCredentialsException(BaseOverkizException):
"""Raised when invalid credentials are provided."""
class InvalidCommandException(BaseOverkizException):
"""Raised when an invalid command is provided."""
class DuplicateActionOnDeviceException(BaseOverkizException):
"""Raised when another action already exists for the same device."""
class ActionGroupSetupNotFoundException(BaseOverkizException):
"""Raised when an action group setup cannot be determined for a gateway."""
class NoSuchResourceException(BaseOverkizException):
"""Raised when an invalid API call is made."""
class ResourceAccessDeniedException(BaseOverkizException):
"""Raised when the API returns a RESOURCE_ACCESS_DENIED error."""
class NotAuthenticatedException(ResourceAccessDeniedException):
"""Raised when the user is not authenticated."""
class TooManyExecutionsException(BaseOverkizException):
"""Raised when too many executions are requested."""
class ExecutionQueueFullException(BaseOverkizException):
"""Raised when the execution queue is full."""
class TooManyRequestsException(BaseOverkizException):
"""Raised when too many requests are made."""
class TooManyConcurrentRequestsException(BaseOverkizException):
"""Raised when too many concurrent requests are made."""
class ServiceUnavailableException(BaseOverkizException):
"""Raised when the service is unavailable."""
class MaintenanceException(ServiceUnavailableException):
"""Raised when the service is under maintenance."""
class MissingAPIKeyException(BaseOverkizException):
"""Raised when the API key is missing."""
class MissingAuthorizationTokenException(ResourceAccessDeniedException):
"""Raised when the authorization token is missing."""
class InvalidEventListenerIdException(BaseOverkizException):
"""Raised when an invalid event listener ID is provided."""
class NoRegisteredEventListenerException(BaseOverkizException):
"""Raised when no event listener is registered."""
class SessionAndBearerInSameRequestException(BaseOverkizException):
"""Raised when both session and bearer are provided in the same request."""
class TooManyAttemptsBannedException(BaseOverkizException):
"""Raised when too many attempts are made and the user is (temporarily) banned."""
class InvalidTokenException(BaseOverkizException):
"""Raised when an invalid token is provided."""
class NotSuchTokenException(BaseOverkizException):
"""Raised when an invalid token is provided."""
class UnknownUserException(BaseOverkizException):
"""Raised when an unknown user is provided."""
class UnknownObjectException(BaseOverkizException):
"""Raised when an unknown object is provided."""
class AccessDeniedToGatewayException(ResourceAccessDeniedException):
"""Raised when access is denied to the gateway. This often happens when the user is not the owner of the gateway."""
class ApplicationNotAllowedException(ResourceAccessDeniedException):
"""Raised when the setup cannot be accessed through the application."""
# Nexity
class NexityBadCredentialsException(BadCredentialsException):
"""Raised when invalid credentials are provided to Nexity authentication API."""
class NexityServiceException(BaseOverkizException):
"""Raised when an error occurs while communicating with the Nexity API."""
# CozyTouch
class CozyTouchBadCredentialsException(BadCredentialsException):
"""Raised when invalid credentials are provided to CozyTouch authentication API."""
class CozyTouchServiceException(BaseOverkizException):
"""Raised when an error occurs while communicating with the CozyTouch API."""
# Somfy
class SomfyBadCredentialsException(BadCredentialsException):
"""Raised when invalid credentials are provided to Somfy authentication API."""
class SomfyServiceException(BaseOverkizException):
"""Raised when an error occurs while communicating with the Somfy API."""