From 6cfe029a8d3d78040cde06d69d1dd57473e5617d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Fri, 25 Nov 2022 16:41:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wrong=20params=20passed=20?= =?UTF-8?q?to=20`isinstance`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/errorhandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/system/errorhandler.py b/plugins/system/errorhandler.py index e0156f1f..f3a4f8ff 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -32,10 +32,10 @@ class ErrorHandler(Plugin): async def error_handler(self, update: object, context: CallbackContext) -> None: """记录错误并发送消息通知开发人员。 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) return - if isinstance(TimedOut, context.error): + if isinstance(context.error, TimedOut): logger.error("Bot请求超时", exc_info=context.error) return