forked from sixs/wenshu_spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.py
37 lines (23 loc) · 835 Bytes
/
error.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
from json import JSONDecodeError
from requests.exceptions import ChunkedEncodingError, RequestException
class NetworkException(Exception):
def __init__(self, value):
self.value = value
self.msg = 'Network Error'
def __str__(self):
return self.value
class CheckCodeError(Exception):
def __init__(self, value):
self.value = value
self.msg = 'CheckCode Error'
def __str__(self):
return self.value
class NullContentError(Exception):
def __init__(self, value):
self.value = value
self.msg = 'Null Content Error'
def __str__(self):
return self.value
ErrorList = (NetworkException, CheckCodeError, JSONDecodeError,
NullContentError, KeyError, IndexError, TypeError,
ChunkedEncodingError, RequestException)