Skip to content

Commit

Permalink
🍻 捕获 Playwright TimeoutError 报错
Browse files Browse the repository at this point in the history
  • Loading branch information
KomoriDev committed Sep 15, 2024
1 parent 0b86015 commit c8d7b92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nonebot_plugin_wakatime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from nonebot.rule import Rule
from nonebot.log import logger
from httpx import ConnectTimeout
from playwright.async_api import TimeoutError
from nonebot.plugin import PluginMetadata, inherit_supported_adapters

require("nonebot_plugin_orm")
Expand Down Expand Up @@ -112,7 +113,7 @@ async def _(user_session: UserSession, target: Match[At | int]):
await UniMessage.text(
f"{target_name}还没有绑定 Wakatime 账号!请私聊我并使用 /wakatime bind 命令进行绑定" # noqa: E501
).finish(at_sender=True)
except ConnectTimeout:
except ConnectTimeout | TimeoutError:
await (
UniMessage.text("网络超时,再试试叭")
.keyboard(Button("input", "重试", text="/wakatime"))
Expand Down

0 comments on commit c8d7b92

Please sign in to comment.