Repository navigation
Report a missing registry file without a traceback - #12
Open
dmccoystephenson wants to merge 1 commit into
Open
dmccoystephenson wants to merge 1 commit into
dmccoystephenson wants to merge 1 commit into
Conversation
main() now catches OSError alongside RegistryError, so routers, hosts, check-registry and serve print one "arcade: <message>" line (exit 1) when the registry path does not exist or cannot be read. Closes #1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (scored against CI run 37757498918 on the PR head and the diff):
Points for the reviewer:
None of the changed paths is on the do-not-auto-merge list. Merging was not authorized for this dispatch, so the PR is left for a maintainer. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
main()insrc/arcade/__main__.pynow catchesOSErroralongsideregistry.RegistryError, so a registry path that does not exist or cannot be read is reported byrouters,hosts,check-registryandserveas a singlearcade: <message>line on stderr instead of a Python traceback. The exit status stays 1, so scripts are unaffected.serve,RegistryHolder.refresh(initial=True)already re-raises theOSErroron first load before anything binds; that error now reaches the same one-line report. A side effect worth noting: any otherOSErrorescaping a handler (for example a bind failure such as "Address already in use" inmakeServer) is also printed as onearcade: ...line with exit 1 rather than a traceback.tests/test_main.py:test_a_missing_registry_is_reported_without_a_traceback(parametrized overrouters,hosts,check-registry) andtest_serve_refuses_a_missing_registry_before_binding.CHANGELOG.md: a### Fixedentry under## [Unreleased].__version__is unchanged.Closes #1
Test plan
python3 -m pytest -q: 149 passed locally (Python 3)__main__.pyfix stashed, the 4 new test cases fail; with it restored, they passtest (3.8),test (3.12),dockerPYTHONPATH=src python3 -m arcade check-registry examples/games.yamlandblack --checkcould not be run locally in this sandbox. CI runscheck-registry, and the diff does not touch the example registry or the parser. The new code was written to black's 110-column style by hand.No other open issues existed at triage, so none were skipped.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson