Repository navigation
cli: one-line messages for expected errors (curate/doctor/stale) - #18
Merged
kstonekuan merged 5 commits intoAug 19, 2026
Merged
Conversation
curate and doctor previously let ValueError/FileNotFoundError bubble up as full tracebacks, reading as crashes rather than user feedback. Extract _command_curate and _command_doctor so main() is pure dispatch, and apply the same except -> one-line stderr -> return 2 pattern that _command_deploy already uses. Closes Hebbian-Robotics#3
This was referenced Aug 19, 2026
Closed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Thanks for the thorough review and for the clear guidance on the good-first-issue pool. Totally understand the one-PR-at-a-time policy — makes sense to keep starter issues available. Happy to iterate on #18 until it's merged, and I'll bring one of the others back (or open new ones) once this one lands. Appreciate the help getting started here! |
kstonekuan
approved these changes
Aug 19, 2026
kstonekuan
left a comment
Contributor
There was a problem hiding this comment.
Thanks @ayam04! Validated locally: quality gate and full test suite pass. This matches the issue spec exactly, including the optional _command_curate/_command_doctor extraction, and the capsys regression tests are just what we wanted. I pushed one tiny commit to your branch applying ruff format to a long line in the new curate test. Merging.
This was referenced Aug 19, 2026
kstonekuan
pushed a commit
that referenced
this pull request
Aug 19, 2026
fetch_uri raised FileNotFoundError(local_file) with the path as the single argument, so str() of the exception was just the bare path and the CLI printed 'doctor: /tmp/nope.mcap' with no 'no such file' hint after #18 turned tracebacks into one-line messages. Raise with errno.ENOENT, os.strerror(errno.ENOENT), and the path as the filename only, so it formats as: [Errno 2] No such file or directory: '/tmp/nope.mcap' Closes #26
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.
Fixes #3
Expected, user-recoverable errors in
curate,doctor, andstalenow print a one-line<command>: <message>on stderr and return exit code 2, instead of leaking a full Python traceback._command_curateand_command_doctorsomain()is pure dispatch (per the issue's companion cleanup)except (ValueError, FileNotFoundError)pattern_command_deployalready used_command_stalenow wraps thestale_episodescall the same wayTests:
test_cli_doctor_missing_file_prints_one_line: exit 2,doctor:on stderr, no tracebacktest_cli_curate_bad_catalog_prints_one_line: exit 2,curate:on stderr, no tracebackValidation:
uv run pytest tests/test_doctor.py tests/test_catalog_curation.py tests/test_runtime_cli.py -q(37 passed).