Repository navigation
Conversation
Up to standards ✅🟢 Issues
|
Closes petercorke#150 LabelMeReader.__init__ used to wrap file/JSON/URL loading in a broad try/except that swallowed OSError, json.JSONDecodeError, TypeError and ValueError and returned None, leaving a half-initialised reader whose callers only failed later with a confusing error. The original exception now propagates with its message and traceback. Scoped to this single quick-win item from petercorke#150; the other items in that umbrella issue are left for separate PRs. Signed-off-by: agentops <agentops@users.noreply.github.com>
This branch has not been deployed
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.
修复内容 / What this fixes
Closes #150
LabelMeReader.__init__原先把文件/JSON/URL 读取包在一个宽泛的try/except里,吞掉
OSError、json.JSONDecodeError、TypeError、ValueError后return None,留下一个半初始化的 reader,调用方要到很晚才会以一个莫名其妙的错误失败。
现在原始异常直接抛出,带原始信息和 traceback —— 正是这个 issue 要求的行为。
实现思路 / Approach
去掉这层
try/except,让加载阶段的原始异常自然传播。不引入新的异常类型、不改公共 API。改动范围仅限 #150 中这一个 quick-win 项,其余项留给独立 PR。
验证 / Verification
(skipped 的用例需要 ROS / 视频文件等本地不具备的环境。)
备注 / Notes
本 PR 由自动化流水线准备:提交前经过语法检查与自审,未触碰无关代码。