forked from ej2/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
53 lines (37 loc) · 1.02 KB
/
exceptions.py
File metadata and controls
53 lines (37 loc) · 1.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
class QuickbooksException(Exception):
def __init__(self, message, error_code=0, detail=""):
super(QuickbooksException, self).__init__(message)
self.error_code = error_code
self.detail = detail
self.message = message
class AuthorizationException(QuickbooksException):
"""
Quickbooks Error Codes from 1 to 499
"""
def __str__(self):
return "QB Auth Exception: " + self.message + " \n\n" + self.detail
class UnsupportedException(QuickbooksException):
"""
Quickbooks Error Codes from 500 to 599
"""
pass
class GeneralException(QuickbooksException):
"""
Quickbooks Error Codes from 600 to 1999
"""
pass
class ValidationException(QuickbooksException):
"""
Quickbooks Error Codes from 2000 to 4999
"""
pass
class SevereException(QuickbooksException):
"""
Quickbooks Error Codes greater than 10000
"""
pass
class ObjectNotFoundException(QuickbooksException):
"""
Quickbooks Error Code 610
"""
pass