-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.py
41 lines (23 loc) · 1.01 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
# coding=utf-8
"""define some exception"""
from .loggerHandler import logger, filter_dict
class MethodError(Exception):
def __str__(self):
logger.warning('none Method input', extra=filter_dict)
return 'none Method, send a method'
class MethodChoiceError(Exception):
def __str__(self):
logger.warning('wrong Method Choice input', extra=filter_dict)
return 'wrong Method, only accept get post'
class IsProxyError(Exception):
def __str__(self):
logger.warning('wrong Proxy express input', extra=filter_dict)
return 'wrong Proxy express, only accept yes/no'
class IsSessionError(Exception):
def __str__(self):
logger.warning('wrong Session express input', extra=filter_dict)
return 'wrong Session express, on accept yes/no'
class ParametersError(Exception):
def __str__(self):
logger.warning('wrong parameters input', extra=filter_dict)
return 'wrong parameters, check it that accept Dict type params'