From 99f2482caf174b2ff862a2e5c215c5bb5ef62011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Sun, 4 Dec 2022 20:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Update=20error=20handler=20for?= =?UTF-8?q?=20`NetworkError`=20and=20`TimedOut`=20exceptions?= 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 f3a4f8ff..4c623879 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -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("处理函数时发生异常")