Hi @Skillter,
Follow-up to the previous security finding, I also noticed multiple instances of bare except: clauses across the codebase:
🔍 Findings
Issue: Bare except clauses (BUG002)
Severity: Medium
Locations:
- Line 80, 96, 114, 123, 153, 173, 199, 208, 269, 365
💡 Why it matters
Bare except: catches everything, including:
SystemExit (when user presses Ctrl+C)
KeyboardInterrupt
GeneratorExit
This can make debugging difficult and mask real issues.
✅ Suggested fix
# Instead of:
try:
do_something()
except: # ❌ Too broad
pass
# Use:
try:
do_something()
except Exception as e: # ✅ Specific
logger.error(f"Failed to do something: {e}")
# or re-raise if needed
raise
If you need to catch everything intentionally, at least log the error:
except Exception as e:
logger.exception("Unexpected error: %s", e)
Tool used
Code Guardian – 183-line code review tool with 7 core rules.
Happy coding!
Hi @Skillter,
Follow-up to the previous security finding, I also noticed multiple instances of bare
except:clauses across the codebase:🔍 Findings
Issue: Bare except clauses (BUG002)
Severity: Medium
Locations:
💡 Why it matters
Bare
except:catches everything, including:SystemExit(when user presses Ctrl+C)KeyboardInterruptGeneratorExitThis can make debugging difficult and mask real issues.
✅ Suggested fix
If you need to catch everything intentionally, at least log the error:
Tool used
Code Guardian – 183-line code review tool with 7 core rules.
Happy coding!