Skip to content

Conversation

@ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Jul 9, 2025

We have this pattern throughout the codebase:

except Exception as e:
    logger.error(f"Something failed: {e}")

Two issues:

  1. Should use logger.exception() instead of logger.error() - it automatically includes the traceback
  2. Most catches should be specific exceptions, not generic Exception

Changes

  • Replaced logger.error()logger.exception() in exception handlers
  • Removed redundant {e} from messages (exception details are included automatically)
  • Added guidelines to CLAUDE.md to prevent this pattern in future PRs

This pattern appears to be spreading because LLMs copy existing code context.

@ihrpr ihrpr requested a review from Kludex July 9, 2025 09:30
@ihrpr ihrpr merged commit 4fee123 into main Jul 9, 2025
22 of 23 checks passed
@ihrpr ihrpr deleted the ihrpr/fix-exceptions branch July 9, 2025 10:15
saqadri pushed a commit to saqadri/stdio-fixes that referenced this pull request Aug 6, 2025
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.

3 participants