网络错误人性化提示

This commit is contained in:
2019-02-01 20:17:39 +08:00
parent e4fef3df33
commit b8b793e292
2 changed files with 8 additions and 0 deletions

3
api.py
View File

@ -221,6 +221,9 @@ if __name__ == "__main__":
if api.isLive:
try:
api.getDanmaku()
except requests.exceptions.BaseHTTPError:
print("网络错误,请确认网络")
time.sleep(5)
except Exception as e:
print(e)
time.sleep(1)