🎨 规范异常捕获

This commit is contained in:
洛水居室 2022-10-11 13:52:42 +08:00
parent 5673635441
commit 70eba45f13
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
3 changed files with 6 additions and 6 deletions

View File

@ -105,7 +105,7 @@ class SignJob(Plugin):
except NeedChallenge:
text = "签到失败,触发验证码风控,自动签到自动关闭"
sign_db.status = SignStatusEnum.NEED_CHALLENGE
except BaseException as exc:
except Exception as exc:
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
@ -122,7 +122,7 @@ class SignJob(Plugin):
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
sign_db.status = SignStatusEnum.FORBIDDEN
except BaseException as exc:
except Exception as exc:
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
continue

View File

@ -1,5 +1,5 @@
import datetime
import asyncio
import datetime
from aiohttp import ClientConnectorError
from genshin import InvalidCookies, AlreadyClaimed, GenshinException
@ -57,7 +57,7 @@ class SignAll(Plugin):
except NeedChallenge:
text = "签到失败,触发验证码风控,自动签到自动关闭"
sign_db.status = SignStatusEnum.NEED_CHALLENGE
except BaseException as exc:
except Exception as exc:
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
@ -75,7 +75,7 @@ class SignAll(Plugin):
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
sign_db.status = SignStatusEnum.FORBIDDEN
except BaseException as exc:
except Exception as exc:
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
logger.exception(exc)
continue

View File

@ -33,7 +33,7 @@ async def send_user_notification(update: Update, _: CallbackContext, text: str):
except Forbidden as exc:
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
logger.exception(exc)
except BaseException as exc:
except Exception as exc:
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
logger.exception(exc)
finally: