mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
统一异常处理
This commit is contained in:
@@ -87,4 +87,4 @@ def do(domain): # 统一入口名字 方便多线程调用
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
do('example.com')
|
||||
do('huawei.com')
|
||||
|
||||
@@ -41,7 +41,7 @@ class Github(Search):
|
||||
try:
|
||||
resp = self.session.post(self.post_url, data=post_data)
|
||||
except Exception as e:
|
||||
logger.log('ERROR', e)
|
||||
logger.log('ERROR', e.args)
|
||||
return False
|
||||
if resp.status_code != 200:
|
||||
return False
|
||||
@@ -58,7 +58,7 @@ class Github(Search):
|
||||
try:
|
||||
resp = self.session.get(self.login_url)
|
||||
except Exception as e:
|
||||
logger.log('ERROR', e)
|
||||
logger.log('ERROR', e.args)
|
||||
return None
|
||||
if resp.status_code != 200:
|
||||
return None
|
||||
@@ -85,7 +85,7 @@ class Github(Search):
|
||||
try:
|
||||
resp = self.session.get(self.addr, params=params)
|
||||
except Exception as e:
|
||||
logger.log('ERROR', e)
|
||||
logger.log('ERROR', e.args)
|
||||
break
|
||||
if resp.status_code != 200:
|
||||
logger.log('ERROR', f'{self.session}模块搜索出错')
|
||||
|
||||
Reference in New Issue
Block a user