PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

Enhancement: Improve database error handling in connection layer

Open Ayushd172005 opened this issue 8 months ago • 3 comments

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

Ayushd172005 avatar Mar 28 '26 13:03 Ayushd172005

šŸ‘‹ 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 :)

github-actions[bot] avatar Mar 28 '26 13:03 github-actions[bot]

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 😊

JITENDRAGAHERWAR03 avatar Mar 30 '26 03:03 JITENDRAGAHERWAR03

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:

  1. Audit the connection layer's broad exception handlers and identify which SQLite failure classes need distinct handling.
  2. Preserve rollback guarantees for write failures, while improving structured logging with operation context that does not expose private photo paths or user data.
  3. Standardize the connection-layer error boundary so route handlers receive consistent, actionable failures rather than database-specific tracebacks.
  4. Add focused tests for locked-database, integrity, connection, and rollback cases.
  5. 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?

1sakshm avatar Sep 05 '26 18:09 1sakshm