🐛 Fix wrong params passed to isinstance

This commit is contained in:
洛水居室 2022-11-25 16:41:50 +08:00
parent 038ad5dba7
commit 6cfe029a8d
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -32,10 +32,10 @@ class ErrorHandler(Plugin):
async def error_handler(self, update: object, context: CallbackContext) -> None: async def error_handler(self, update: object, context: CallbackContext) -> None:
"""记录错误并发送消息通知开发人员。 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(NetworkError, context.error): if isinstance(context.error, NetworkError):
logger.error("Bot请求异常", exc_info=context.error) logger.error("Bot请求异常", exc_info=context.error)
return return
if isinstance(TimedOut, context.error): if isinstance(context.error, TimedOut):
logger.error("Bot请求超时", exc_info=context.error) logger.error("Bot请求超时", exc_info=context.error)
return return