Describe the bug
Currently, backend/app/database/images.py and backend/app/database/folders.py use broad except Exception as e: blocks for SQLite database operations instead of catching specific sqlite3.Error exceptions.
Additionally, some of these blocks may be using print() or returning generic strings instead of using the central logger to report the error properly.
This makes debugging database failures harder and is inconsistent with the error handling improvements being made in other database files (like faces.py and face_clusters.py).
Expected Behavior
- Replace broad
except Exception as e: with except sqlite3.Error as e: where appropriate.
- Ensure all exceptions are logged using the project's
logger.error(...) instead of print().
I can submit a PR to fix this! Let me know if I can be assigned.
Describe the bug
Currently,
backend/app/database/images.pyandbackend/app/database/folders.pyuse broadexcept Exception as e:blocks for SQLite database operations instead of catching specificsqlite3.Errorexceptions.Additionally, some of these blocks may be using
print()or returning generic strings instead of using the central logger to report the error properly.This makes debugging database failures harder and is inconsistent with the error handling improvements being made in other database files (like
faces.pyandface_clusters.py).Expected Behavior
except Exception as e:withexcept sqlite3.Error as e:where appropriate.logger.error(...)instead ofprint().I can submit a PR to fix this! Let me know if I can be assigned.