From 350322831d5607be5200362830636da29fa3cb68 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, 20 Sep 2022 14:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E6=8D=95=E8=8E=B7=20`DataNotPub?= =?UTF-8?q?lic`=20=E5=BC=82=E5=B8=B8=E5=B9=B6=E6=94=B9=E8=BF=9B=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/decorators/error.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/decorators/error.py b/utils/decorators/error.py index c331eae..a009e5b 100644 --- a/utils/decorators/error.py +++ b/utils/decorators/error.py @@ -3,7 +3,7 @@ from functools import wraps from typing import Callable, cast from aiohttp import ClientConnectorError -from genshin import InvalidCookies, GenshinException, TooManyRequests +from genshin import InvalidCookies, GenshinException, TooManyRequests, DataNotPublic from httpx import ConnectTimeout from telegram import Update, ReplyKeyboardRemove from telegram.error import BadRequest, TimedOut, Forbidden @@ -93,11 +93,15 @@ def error_callable(func: Callable) -> Callable: logger.warning("查询次数太多(操作频繁)", exc) await send_user_notification(update, context, "出错了呜呜呜 ~ 当天查询次数已经超过30次,请次日再进行查询") return ConversationHandler.END + except DataNotPublic: + await send_user_notification(update, context, "出错了呜呜呜 ~ 查询的用户数据未公开") + return ConversationHandler.END except GenshinException as exc: if "[-130]" in str(exc): await send_user_notification(update, context, "出错了呜呜呜 ~ 未设置默认角色,请尝试重新绑定默认角色") return ConversationHandler.END - logger.warning("GenshinException", exc) + logger.warning("GenshinException") + logger.exception(exc) await send_user_notification(update, context, "出错了呜呜呜 ~ 获取账号信息发生错误") return ConversationHandler.END except BadRequest as exc: