-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexceptions.py
More file actions
51 lines (36 loc) · 880 Bytes
/
Copy pathexceptions.py
File metadata and controls
51 lines (36 loc) · 880 Bytes
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
"""
exceptions
~~~~~~~~~~
Custom exceptions raised by the nextcode-sdk.
"""
from typing import Dict
class ServerError(Exception):
"""
Raised when there was some sort of an error triggered by the server.
"""
response: Dict = {}
url: str = ""
def __init__(self, message, response=None, url=None, **kw):
self.response = response
self.url = url
self.message = message
def __str__(self):
ret = self.message
if self.url:
ret += " - {}".format(self.url)
return ret
class InvalidToken(Exception):
"""
JWT Token (API Key or access token) is invalid.
"""
pass
class InvalidProfile(Exception):
"""
The selected profile is invalid.
"""
pass
class ServiceNotFound(Exception):
"""
The requested server is not available on the server.
"""
pass