From 91a7e93d1d3aa4ec9da9351c7cde88894c8d6d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Sat, 10 Sep 2022 12:02:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20`error=5Fha?= =?UTF-8?q?ndler`=20=E6=97=A0=E6=B3=95=E6=89=93=E5=8D=B0=20`tranceback`=20?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= 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 06c3750..be35447 100644 --- a/plugins/system/errorhandler.py +++ b/plugins/system/errorhandler.py @@ -21,7 +21,7 @@ class ErrorHandler(Plugin): """记录错误并发送消息通知开发人员。 logger the error and send a telegram message to notify the developer.""" logger.error("处理函数时发生异常") - logger.exception(context.error) + logger.exception(context.error, exc_info=(type(context.error), context.error, context.error.__traceback__)) if notice_chat_id is None: return @@ -61,7 +61,7 @@ class ErrorHandler(Plugin): try: await context.bot.send_message(notice_chat_id, text, parse_mode=ParseMode.HTML) except BadRequest as exc_1: - logger.error("处理函数时发生异常", exc_1) + logger.exception(exc_1) effective_user = update.effective_user effective_message = update.effective_message try: