mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-22 06:17:54 +00:00
🎨 规范异常捕获
This commit is contained in:
parent
5673635441
commit
70eba45f13
@ -105,7 +105,7 @@ class SignJob(Plugin):
|
|||||||
except NeedChallenge:
|
except NeedChallenge:
|
||||||
text = "签到失败,触发验证码风控,自动签到自动关闭"
|
text = "签到失败,触发验证码风控,自动签到自动关闭"
|
||||||
sign_db.status = SignStatusEnum.NEED_CHALLENGE
|
sign_db.status = SignStatusEnum.NEED_CHALLENGE
|
||||||
except BaseException as exc:
|
except Exception as exc:
|
||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
|
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
|
||||||
@ -122,7 +122,7 @@ class SignJob(Plugin):
|
|||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
sign_db.status = SignStatusEnum.FORBIDDEN
|
sign_db.status = SignStatusEnum.FORBIDDEN
|
||||||
except BaseException as exc:
|
except Exception as exc:
|
||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
continue
|
continue
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import datetime
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import datetime
|
||||||
|
|
||||||
from aiohttp import ClientConnectorError
|
from aiohttp import ClientConnectorError
|
||||||
from genshin import InvalidCookies, AlreadyClaimed, GenshinException
|
from genshin import InvalidCookies, AlreadyClaimed, GenshinException
|
||||||
@ -57,7 +57,7 @@ class SignAll(Plugin):
|
|||||||
except NeedChallenge:
|
except NeedChallenge:
|
||||||
text = "签到失败,触发验证码风控,自动签到自动关闭"
|
text = "签到失败,触发验证码风控,自动签到自动关闭"
|
||||||
sign_db.status = SignStatusEnum.NEED_CHALLENGE
|
sign_db.status = SignStatusEnum.NEED_CHALLENGE
|
||||||
except BaseException as exc:
|
except Exception as exc:
|
||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
|
text = "签到失败了呜呜呜 ~ 执行自动签到时发生错误"
|
||||||
@ -75,7 +75,7 @@ class SignAll(Plugin):
|
|||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
sign_db.status = SignStatusEnum.FORBIDDEN
|
sign_db.status = SignStatusEnum.FORBIDDEN
|
||||||
except BaseException as exc:
|
except Exception as exc:
|
||||||
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
logger.error(f"执行自动签到时发生错误 用户UID[{user_id}]")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
continue
|
continue
|
||||||
|
@ -33,7 +33,7 @@ async def send_user_notification(update: Update, _: CallbackContext, text: str):
|
|||||||
except Forbidden as exc:
|
except Forbidden as exc:
|
||||||
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
|
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
except BaseException as exc:
|
except Exception as exc:
|
||||||
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
|
logger.error(f"发送 update_id[{update.update_id}] 错误信息失败 错误信息为")
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user