统一异常处理

This commit is contained in:
shmilylty
2019-12-10 12:12:44 +08:00
parent 0cafe696a6
commit f5d02d74ef
11 changed files with 35 additions and 35 deletions
+3 -3
View File
@@ -96,8 +96,8 @@ async def fetch(session, url):
except UnicodeDecodeError:
text = await resp.text(errors='ignore')
return resp, text
except BaseException as exception:
return exception
except Exception as e:
return e
def get_title(markup):
@@ -146,7 +146,7 @@ def get_title(markup):
def request_callback(future, index, datas):
try:
result = future.result()
except BaseException as e:
except Exception as e:
logger.log('TRACE', e.args)
datas[index]['reason'] = str(e.args)
datas[index]['valid'] = 0