Browse Source

update: exception utils

dev
dnomd343 2 years ago
parent
commit
ca8b6ca029
  1. 12
      Utils/Exception.py
  2. 18
      log.py

12
Basis/Exception.py → Utils/Exception.py

@ -1,31 +1,31 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
class buildException(Exception): # for build error class buildException(Exception): # build exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason
class filterException(Exception): # for filter error class filterException(Exception): # filter exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason
class processException(Exception): # for process error class processException(Exception): # process exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason
class managerException(Exception): # for manager error class managerException(Exception): # manager exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason
class checkException(Exception): # for check error class checkException(Exception): # check exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason
class decodeException(Exception): # for url decode class decodeException(Exception): # url exception
def __init__(self, reason): def __init__(self, reason):
self.reason = reason self.reason = reason

18
log.py

@ -1,18 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from Basis import Constant
Constant.LogLevel = 'DEBUG'
from Utils.Logger import logger
import requests
logger.debug('debug')
logger.info('info')
logger.warning('warning')
logger.error('error')
logger.critical('critical')
requests.get('https://baidu.com')
Loading…
Cancel
Save