From 5f3da3b55cd800c5ced98900e6ef70634205650b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Thu, 9 Feb 2023 13:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Handling=20Exception=20Err?= =?UTF-8?q?or?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/player_cards.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/player_cards.py b/plugins/genshin/player_cards.py index ffe3f3a5..7794a257 100644 --- a/plugins/genshin/player_cards.py +++ b/plugins/genshin/player_cards.py @@ -18,6 +18,7 @@ from enkanetwork import ( EnkaServerMaintanance, EnkaServerUnknown, EnkaServerRateLimit, + EnkaPlayerNotFound, ) from pydantic import BaseModel from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update @@ -78,8 +79,10 @@ class PlayerCards(Plugin, BasePlugin): error = "Enka.Network 服务请求错误,请稍后重试" except EnkaServerUnknown: error = "Enka.Network 服务瞬间爆炸,请稍后重试" - except (VaildateUIDError, VaildateUIDError): + except EnkaPlayerNotFound: error = "UID 未找到,可能为服务器抽风,请稍后重试" + except VaildateUIDError: + error = "未找到玩家,请检查您的UID/用户名" except HTTPException: error = "Enka.Network HTTP 服务请求错误,请稍后重试" old_data = await self.player_cards_file.load_history_info(uid)