-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathexceptions.py
113 lines (59 loc) · 3.42 KB
/
exceptions.py
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
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 NoSuchResourceException(BaseOverkizException):
"""Raised when an invalid API call is made."""
class NotAuthenticatedException(BaseOverkizException):
"""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 MissingAuthorizationTokenException(BaseOverkizException):
"""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(BaseOverkizException):
"""Raised when access is denied to the gateway. This often happens when the user is not the owner of the gateway."""
# 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."""