mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 12:51:35 +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."""
|
||||
|
||||
if isinstance(context.error, NetworkError):
|
||||
logger.error("Bot请求异常", exc_info=context.error)
|
||||
logger.error("Bot请求异常 %s", context.error.message)
|
||||
return
|
||||
if isinstance(context.error, TimedOut):
|
||||
logger.error("Bot请求超时", exc_info=context.error)
|
||||
logger.error("Bot请求超时 %s", context.error.message)
|
||||
return
|
||||
|
||||
logger.error("处理函数时发生异常")
|
||||
|
Loading…
Reference in New Issue
Block a user