Skip to content

Commit cb9cf7e

Browse files
committed
fix(net): resolve FinishedException misinterpretation in cache handling
1 parent 8c75d56 commit cb9cf7e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nonebot_plugin_maimaimonitor/maimai_plugin_v11.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ async def handle_net(matcher: Matcher):
6767
try:
6868
await matcher.send(MessageSegment.image(cache_file.read_bytes()))
6969
await matcher.finish()
70-
except Exception:
70+
except Exception as e:
71+
if "FinishedException" in type(e).__name__:
72+
raise e
7173
cache_file.unlink(missing_ok=True)
7274

7375
try:
@@ -92,7 +94,7 @@ async def handle_net(matcher: Matcher):
9294
else:
9395
await matcher.finish(f"获取状态图失败 (HTTP {response.status_code})\nURL: {OG_API_URL}\n请检查网络连接或 API 状态。")
9496
except Exception as e:
95-
if isinstance(e, Matcher.finish) or "FinishedException" in type(e).__name__:
97+
if "FinishedException" in type(e).__name__:
9698
raise e
9799

98100
error_type = type(e).__name__

0 commit comments

Comments
 (0)