fix(twin): /alert/push 捕获 TwinStationError 转 404,对齐同文件其他端点 - #9
Open
leaderwm wants to merge 1 commit into
Open
Conversation
非法/未知 stationId 原直接 500;station_layout 等兄弟端点均有 except TwinStationError → BizError(404) 处理,唯 push 漏了
leaderwm
force-pushed
the
fix/twin-alert-push-404
branch
from
September 4, 2026 10:30
3ab8d37 to
4267076
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
POST /twin/alert/push未捕获TwinStationError:非法/未知stationId会直接 500。同文件的station_layout等端点均有except twin_service.TwinStationError → BizError(str(exc), 404)处理,唯 push 漏了。改动
对齐兄弟端点写法补 try/except 转 404(一行包裹 + 注释)。
验证
python -m pytest tests/ -q --ignore=tests/test_api.py -m "not integration":828 passed(3 个失败为 main 上已存在的 test_batch3_infra openai SDK 环境差异,与本 PR 无关,已在未改动代码上复现确认)python scripts/validate_golden.py通过