-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
80 lines (53 loc) · 2.02 KB
/
Copy pathexceptions.py
File metadata and controls
80 lines (53 loc) · 2.02 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
"""BBData Exception Classes
Includes four exceptions: :class:
`.ResourceUnchangedException`, `.ResourceException`, `.UnknownResponseException` when something is
wrong on the server side. And if something happend on the client side, there is `.ClientException`.
If you need to create a new exception, extend the base class `.BBDataException`.
"""
class BBDataException(Exception):
"""The base BBData Exception that all other exception classes extend."""
class ResourceUnchangedException(BBDataException):
"""Exception raised when a query didn't modify the resource
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
class ResourceException(BBDataException):
"""Exception raised when a resource:
- isn't found
- you don't have access to it
- the request is malformed
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
class UnknownResponseException(BBDataException):
"""Exception raised when the response to an API call is unknown
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
class UnauthorizedException(BBDataException):
"""Exception raised when the user requests a resource he doesn't have access to.
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
class LoginRequiredException(BBDataException):
"""Exception raised when the user requests a resource he doesn't have access to.
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message
class ClientException(BBDataException):
"""Exception raised that don't involve interaction with BBData's API.
Attributes:
message -- explanation of the error
"""
def __init__(self, message):
self.message = message