From f67eb74c0455359a1ea45f4e070db897b5af5659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Tue, 21 Feb 2023 09:27:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Update=20Error=20Handler=20for?= =?UTF-8?q?=20Send=20User=20Notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/decorators/error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/decorators/error.py b/utils/decorators/error.py index 307887c..11019e6 100644 --- a/utils/decorators/error.py +++ b/utils/decorators/error.py @@ -48,8 +48,8 @@ async def send_user_notification(update: Update, context: CallbackContext, text: await update.callback_query.answer(text, show_alert=True) return None return await message.reply_text(text, reply_markup=buttons, allow_sending_without_reply=True) - except ConnectTimeout: - logger.error("httpx 模块连接服务器 ConnectTimeout 发送 update_id[%s] 错误信息失败", update.update_id) + except TimedOut: + logger.error("发送 update_id[%s] 错误信息失败 连接超时", update.update_id) except BadRequest as exc: logger.error("发送 update_id[%s] 错误信息失败 错误信息为 [%s]", update.update_id, exc.message) except Forbidden as exc: