Skip to content

Handle ParseError in CLI commands for malformed input#22

Open
dithesh12 wants to merge 1 commit into
jmestwa-coder:mainfrom
dithesh12:fix-cli-parseerror
Open

Handle ParseError in CLI commands for malformed input#22
dithesh12 wants to merge 1 commit into
jmestwa-coder:mainfrom
dithesh12:fix-cli-parseerror

Conversation

@dithesh12

Copy link
Copy Markdown

Fixes #10

Summary

This PR handles ParseError in the CLI layer when processing malformed or truncated input.

Changes

  • Catch ParseError in parse_command
  • Catch ParseError in validate_command
  • Display a user-facing error message instead of exposing a full traceback
  • Return a non-zero exit code on failure

Validation

Malformed input:

python -m sigflow parse broken.sgf

Output:

error: truncated input

Malformed input:

python -m sigflow validate broken.sgf

Output:

error: truncated input

Valid input continues to behave as before:

python -m sigflow parse samples/valid_telemetry.sgf

This keeps parser behavior unchanged and scopes the fix to the CLI layer only, as discussed in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI commands crash with unhandled ParseError on malformed input

1 participant