AOSSIE-Org / AOSSIE-Org/PictoPy

fix: improve SQLite error handling and logging in face_clusters.py

Aperta
#1,230 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
283
Fork
679
Merge medio
7g 2h
PR unite (30g)
3

Descrizione

`face_clusters.py` has multiple problems:

- `db_delete_all_clusters` uses broad `except Exception` and `print()` instead of logging
- `db_insert_clusters_batch` catches no exceptions at all
- 5 other functions have no exception handling

### Proposed fix
- Replace `except Exception` with `sqlite3.Error` across all functions
- Replace `print()` with `logger.error()`
- Add `sqlite3.Error` handling to unprotected functions
- Add `import logging` and `logger = logging.getLogger(__name__)`

I'd like to fix this.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.