fix: improve exception handling in database connection#1151
fix: improve exception handling in database connection#1151riyagoyal01 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds module-level logging setup and refines error handling in the database connection module to catch Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1102
What this PR does
This PR improves error handling in the
get_db_connectioncontext manager by catching database-specific exceptions and adding structured logging.Changes made
except Exceptionwithexcept sqlite3.Errorto handle database-related errors explicitlylogger.exception()for better debugging and traceabilityWhy this change is needed
Previously, the code used a generic
except Exceptionblock, which:Using
sqlite3.Errorwith logging makes error handling:Tested
Summary by CodeRabbit