Skip to content

feat: add --debug flag to print full traceback on failure#9

Merged
rasros merged 1 commit into
mainfrom
feat/debug-traceback-flag
Jul 10, 2026
Merged

feat: add --debug flag to print full traceback on failure#9
rasros merged 1 commit into
mainfrom
feat/debug-traceback-flag

Conversation

@rasros

@rasros rasros commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

The top-level exception handler in main.py swallowed the traceback, printing only a one-line Error: .... That's the right default for users, but it made real bugs hard to diagnose.

Adds a --debug flag. On failure:

  • default: the clean one-line error plus a hint — (run with --debug for the full traceback)
  • --debug: the clean line followed by the full traceback

How

A small _fail(message, debug) helper centralizes the exit path for both the FileNotFoundError and generic Exception handlers. It's documented as must-call-from-except so traceback.print_exc() sees the active exception.

Tests

CLI parse tests for the flag (default off, --debug on) plus two _fail tests asserting the hint-vs-traceback behavior. Full suite: 375 passed.

@rasros rasros merged commit 0ea8d93 into main Jul 10, 2026
1 check passed
@rasros rasros deleted the feat/debug-traceback-flag branch July 10, 2026 19:07
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.

1 participant