Context
In PR #987, a code review suggested using logger.exception() instead of logger.error() for exception handling. This change was deferred because it should be applied consistently across the entire codebase rather than in a single PR.
Description
Currently, the codebase uses logger.error() in various places where exceptions are being logged. Django's logger.exception() is preferred because it automatically includes the full exception traceback, making debugging easier.
Proposed Change
- Audit the codebase for instances where
logger.error() is used within exception handlers
- Replace with
logger.exception() to automatically capture stack traces
- Ensure consistency across all modules
References
Context
In PR #987, a code review suggested using
logger.exception()instead oflogger.error()for exception handling. This change was deferred because it should be applied consistently across the entire codebase rather than in a single PR.Description
Currently, the codebase uses
logger.error()in various places where exceptions are being logged. Django'slogger.exception()is preferred because it automatically includes the full exception traceback, making debugging easier.Proposed Change
logger.error()is used within exception handlerslogger.exception()to automatically capture stack tracesReferences