mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-22 14:26:45 +00:00
🎨 Update error handler for NetworkError
and TimedOut
exceptions
This commit is contained in:
parent
e20e20111d
commit
99f2482caf
@ -33,10 +33,10 @@ class ErrorHandler(Plugin):
|
|||||||
"""记录错误并发送消息通知开发人员。 logger the error and send a telegram message to notify the developer."""
|
"""记录错误并发送消息通知开发人员。 logger the error and send a telegram message to notify the developer."""
|
||||||
|
|
||||||
if isinstance(context.error, NetworkError):
|
if isinstance(context.error, NetworkError):
|
||||||
logger.error("Bot请求异常", exc_info=context.error)
|
logger.error("Bot请求异常 %s", context.error.message)
|
||||||
return
|
return
|
||||||
if isinstance(context.error, TimedOut):
|
if isinstance(context.error, TimedOut):
|
||||||
logger.error("Bot请求超时", exc_info=context.error)
|
logger.error("Bot请求超时 %s", context.error.message)
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.error("处理函数时发生异常")
|
logger.error("处理函数时发生异常")
|
||||||
|
Loading…
Reference in New Issue
Block a user