Enhancement: Improve database error handling in connection layer
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
The current database layer uses broad exception handling, which makes debugging difficult.
This issue proposes:
- Using specific SQLite exceptions
- Improving error logging
This is being addressed in PR #1246. https://github.com/AOSSIE-Org/PictoPy/pull/1246
Record
- [x] I agree to follow this project's Code of Conduct
š Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
Hello š I am interested in working on this issue. I have basic knowledge of Python and Iām eager to learn and contribute. I will try to provide a clean and well-documented solution. Please assign this issue to me if possible. Thank you š
Hi, I'm interested in contributing to #1249. I see the issue references PR #1246, so I do not want to duplicate or conflict with that work. If that PR is no longer active or maintainers identify remaining follow-up work, I would be happy to take an approved portion.
My proposed follow-up approach would be:
- Audit the connection layer's broad exception handlers and identify which SQLite failure classes need distinct handling.
- Preserve rollback guarantees for write failures, while improving structured logging with operation context that does not expose private photo paths or user data.
- Standardize the connection-layer error boundary so route handlers receive consistent, actionable failures rather than database-specific tracebacks.
- Add focused tests for locked-database, integrity, connection, and rollback cases.
- Keep the change narrowly scoped to error handling; no schema, migration, or query-behavior changes without separate approval.
If maintainers confirm there is remaining unclaimed work after PR #1246, could you please assign that scoped follow-up to me?