β Problem Statement
Across multiple scripts in the repository (such as various game files and math utility scripts), error handling relies on broad except: or except Exception: blocks.
These broad catches swallow unexpected errors (like missing assets, syntax issues in sub-modules, or keyboard interrupts) without printing a proper traceback. This makes debugging incredibly hard for both contributors locally and maintainers reviewing code quality.
π Proposed Enhancement
I propose a codebase-wide enhancement to standardize error handling in the main python scripts. Instead of letting execution silently continue or fail with generic warnings, unexpected errors should display clean, informative tracebacks or be caught using narrow, specific exception types (e.g., ValueError, FileNotFoundError).
π οΈ Suggested Implementation
πΉ Code Refactoring
- Target Identification: Scan the
games/ and math/ directories for files implementing generic try-except clauses.
- Specific Exceptions: Replace generic
except: statements with localized error checking (e.g., handling specific type mismatches or incorrect user inputs explicitly).
- Traceback Logging: Incorporate the standard
traceback library where essential to ensure deep-rooted execution bugs bubble up explicitly during testing rather than failing silently.
π Checklist
β Problem Statement
Across multiple scripts in the repository (such as various game files and math utility scripts), error handling relies on broad
except:orexcept Exception:blocks.These broad catches swallow unexpected errors (like missing assets, syntax issues in sub-modules, or keyboard interrupts) without printing a proper traceback. This makes debugging incredibly hard for both contributors locally and maintainers reviewing code quality.
π Proposed Enhancement
I propose a codebase-wide enhancement to standardize error handling in the main python scripts. Instead of letting execution silently continue or fail with generic warnings, unexpected errors should display clean, informative tracebacks or be caught using narrow, specific exception types (e.g.,
ValueError,FileNotFoundError).π οΈ Suggested Implementation
πΉ Code Refactoring
games/andmath/directories for files implementing generic try-except clauses.except:statements with localized error checking (e.g., handling specific type mismatches or incorrect user inputs explicitly).tracebacklibrary where essential to ensure deep-rooted execution bugs bubble up explicitly during testing rather than failing silently.π Checklist