-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.py
89 lines (57 loc) · 2.56 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
class YooMoneyError(Exception):
"""Basic class"""
class InvalidToken(YooMoneyError):
message = "Token is not valid, or does not have the appropriate rights"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamType(YooMoneyError):
message = "Invalid parameter value 'type'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamStartRecord(YooMoneyError):
message = "Invalid parameter value 'start_record'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamRecords(YooMoneyError):
message = "Invalid parameter value 'records'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamLabel(YooMoneyError):
message = "Invalid parameter value 'label'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamFromDate(YooMoneyError):
message = "Invalid parameter value 'from_date'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamTillDate(YooMoneyError):
message = "Invalid parameter value 'till_date'"
def __init__(self, ):
super().__init__(self.message)
class IllegalParamOperationId(YooMoneyError):
message = "Invalid parameter value 'operation_id'"
def __init__(self, ):
super().__init__(self.message)
class TechnicalError(YooMoneyError):
message = "Technical error, try calling the operation again later"
def __init__(self, ):
super().__init__(self.message)
class InvalidRequest(YooMoneyError):
message = "Required query parameters are missing or have incorrect or invalid values"
def __init__(self, ):
super().__init__(self.message)
class UnauthorizedClient(YooMoneyError):
message = "Invalid parameter value 'client_id' or 'client_secret', or the application" \
" does not have the right to request authorization (for example, YooMoney blocked it 'client_id')"
def __init__(self, ):
super().__init__(self.message)
class InvalidGrant(YooMoneyError):
message = "In issue 'access_token' denied. YuMoney did not issue a temporary token, " \
"the token is expired, or this temporary token has already been issued " \
"'access_token' (repeated request for an authorization token with the same temporary token)"
def __init__(self, ):
super().__init__(self.message)
class EmptyToken(YooMoneyError):
message = "Response token is empty. Repeated request for an authorization token"
def __init__(self, ):
super().__init__(self.message)