@@ -3,101 +3,146 @@ def __init__(self, message: str) -> None:
33 super ().__init__ (message )
44
55 self .message : str = message
6- self .code : str = 'SOURCE_NOT_AVAILABLE'
7- self .desc : str = 'This error occurs when the client chooses nonexistent source.'
6+ self .code : str = "SOURCE_NOT_AVAILABLE"
7+ self .desc : str = (
8+ "This error occurs when the client chooses nonexistent source."
9+ )
810 self .critical : bool = False
911
12+
1013class Unknown (Exception ):
1114 def __init__ (self , message : str ) -> None :
1215 super ().__init__ (message )
1316
14- self .code : str = 'UNKNOWN'
15- self .desc : str = 'This error occours when was not possible to determine the error root cause.'
17+ self .code : str = "UNKNOWN"
18+ self .desc : str = (
19+ "This error occours when was not possible to "
20+ "determine the error root cause."
21+ )
1622 self .critical : bool = True
1723
24+
1825class NotFound (Exception ):
1926 def __init__ (self , message : str ) -> None :
2027 super ().__init__ (message )
2128
22- self .code : str = 'NOT_FOUND'
23- self .desc : str = 'This error occours when was not possible to find the requested resource.'
29+ self .code : str = "NOT_FOUND"
30+ self .desc : str = (
31+ "This error occours when was not possible to "
32+ "find the requested resource."
33+ )
2434 self .critical : bool = True
2535
36+
2637class Forbidden (Exception ):
2738 def __init__ (self , message : str ) -> None :
2839 super ().__init__ (message )
2940
30- self .code : str = 'FORBIDDEN'
31- self .desc : str = 'This error occours when the client can\' t perform a request to the source due lack of credentials.'
41+ self .code : str = "FORBIDDEN"
42+ self .desc : str = (
43+ "This error occours when the client can't perform a request to "
44+ "the source due lack of credentials."
45+ )
3246 self .critical : bool = True
3347
48+
3449class InvalidRequest (Exception ):
3550 def __init__ (self , message : str ) -> None :
3651 super ().__init__ (message )
3752
38- self .code : str = 'INVALID_REQUEST'
39- self .desc : str = 'This error occours when the client tries to perform an request with wrong data input.'
53+ self .code : str = "INVALID_REQUEST"
54+ self .desc : str = (
55+ "This error occours when the client tries to "
56+ "perform an request with wrong data input."
57+ )
4058 self .critical : bool = True
4159
60+
4261class InvalidResource (Exception ):
4362 def __init__ (self , message : str ) -> None :
4463 super ().__init__ (message )
4564
4665 self .message : str = message
47- self .code : str = 'INVALID_RESOURCE'
48- self .desc : str = 'This error occurs when the client tries to perform an action with an invalid resource.'
66+ self .code : str = "INVALID_RESOURCE"
67+ self .desc : str = (
68+ "This error occurs when the client tries to "
69+ "perform an action with an invalid resource."
70+ )
4971 self .critical : bool = True
5072
73+
5174class NhentaiSourceWithoutConfig (Exception ):
5275 def __init__ (self , message : str ) -> None :
5376 super ().__init__ (message )
5477
5578 self .message : str = message
56- self .code : str = 'NHENTAI_SOURCE_WITHOUT_CONFIG'
57- self .desc : str = 'This error occurs when the client tries to use Nhentai source with no cloudflare cookie.'
79+ self .code : str = "NHENTAI_SOURCE_WITHOUT_CONFIG"
80+ self .desc : str = (
81+ "This error occurs when the client tries to "
82+ "use Nhentai source with no cloudflare cookie."
83+ )
5884 self .critical : bool = True
5985
86+
6087class InvalidConfig (Exception ):
6188 def __init__ (self , message : str ) -> None :
6289 super ().__init__ (message )
6390
6491 self .message : str = message
65- self .code : str = 'INVALID_CONFIG'
66- self .desc : str = 'This error occurs when client tries to set wrong config object.'
92+ self .code : str = "INVALID_CONFIG"
93+ self .desc : str = (
94+ "This error occurs when client tries to set wrong config object."
95+ )
6796 self .critical : bool = True
6897
98+
6999class InstanceError (Exception ):
70100 def __init__ (self , message : str ) -> None :
71101 super ().__init__ (message )
72102
73103 self .message : str = message
74- self .code : str = 'INSTANCE_ERROR'
75- self .desc : str = 'This error occurs when the client tries to create an instance with wrong type.'
104+ self .code : str = "INSTANCE_ERROR"
105+ self .desc : str = (
106+ "This error occurs when the client tries to "
107+ "create an instance with wrong type."
108+ )
76109 self .critical : bool = True
77110
111+
78112class SourceWasNotDefined (Exception ):
79113 def __init__ (self , message : str ) -> None :
80114 super ().__init__ (message )
81115
82116 self .message : str = message
83- self .code : str = 'SOURCE_WAS_NOT_DEFINED'
84- self .desc : str = 'This error occurs when the client tries to perform Enma operations before of setting a source.'
117+ self .code : str = "SOURCE_WAS_NOT_DEFINED"
118+ self .desc : str = (
119+ "This error occurs when the client tries to "
120+ "perform Enma operations before of setting a source."
121+ )
85122 self .critical : bool = True
86123
124+
87125class ExceedRetryCount (Exception ):
88126 def __init__ (self , message : str ) -> None :
89127 super ().__init__ (message )
90128
91129 self .message : str = message
92- self .code : str = 'EXCEED_RETRY_COUNT'
93- self .desc : str = 'This error occurs when enma tries perform some action but something went wrong.'
130+ self .code : str = "EXCEED_RETRY_COUNT"
131+ self .desc : str = (
132+ "This error occurs when enma tries to "
133+ "perform some action but something went wrong."
134+ )
94135 self .critical : bool = True
95136
137+
96138class ExceedRateLimit (Exception ):
97139 def __init__ (self , message : str ) -> None :
98140 super ().__init__ (message )
99141
100142 self .message : str = message
101- self .code : str = 'EXCEED_RATE_EXCEED'
102- self .desc : str = 'This error occurs when enma perform more requests than a server can handle. Cool down your requests to this source!'
143+ self .code : str = "EXCEED_RATE_EXCEED"
144+ self .desc : str = (
145+ "This error occurs when enma perform more requests than "
146+ "a server can handle. Cool down your requests to this source!"
147+ )
103148 self .critical : bool = False
0 commit comments