We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90efcbe commit f00348bCopy full SHA for f00348b
nonebot_plugin_fishspeech_tts/on_start_up.py
@@ -1,4 +1,4 @@
1
-from httpx import AsyncClient, HTTPStatusError
+from httpx import AsyncClient, TimeoutException
2
from nonebot import get_driver
3
from nonebot.log import logger
4
@@ -16,6 +16,8 @@ async def check_online_api():
16
async with AsyncClient() as client:
17
try:
18
response = await client.get(API)
19
- response.raise_for_status()
20
- except HTTPStatusError as e:
+ rsp_text = response.text
+ if "Nothing" in rsp_text:
21
+ logger.warning("在线API可用")
22
+ except TimeoutException as e:
23
logger.warning(f"在线API不可用: {e}\n请尝试更换API地址或配置代理")
0 commit comments