forked from biicode/common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exception.py
77 lines (41 loc) · 1.35 KB
/
exception.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
class BiiException(Exception):
'''Base class for all bii custom exceptions'''
pass
class ConfigurationFileError(BiiException):
'''Risen when trying to read a missformatted file'''
pass
class BiiSerializationException(BiiException):
pass
class PublishException(BiiException):
pass
class UpToDatePublishException(PublishException):
pass
class InvalidNameException(BiiException):
pass
######## Remote related exceptions ########
class BiiServiceException(BiiException):
pass
########## 3xx Redirect Codes ##############
class BiiRequestRedirectionException(BiiServiceException): # Generic 300
pass
########## 4xx Request Errors ################
class BiiRequestErrorException(BiiServiceException): # Generic 400
pass
class AuthenticationException(BiiRequestErrorException): # 401
pass
class NotActivatedUser(AuthenticationException): # 421
pass
class ForbiddenException(BiiRequestErrorException): # 403
pass
class NotFoundException(BiiRequestErrorException): # 404
pass
########## 5xx Server Errors ################
class ServerInternalErrorException(BiiServiceException): # Generic 500
pass
# Store exceptions
class BiiStoreException(BiiException):
pass
class AlreadyInStoreException(BiiStoreException):
pass
class NotInStoreException(BiiStoreException):
pass