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.
face_clusters.pyhas multiple problems:db_delete_all_clustersuses broadexcept Exceptionandprint()instead of loggingdb_insert_clusters_batchcatches no exceptions at allProposed fix
except Exceptionwithsqlite3.Erroracross all functionsprint()withlogger.error()sqlite3.Errorhandling to unprotected functionsimport loggingandlogger = logging.getLogger(__name__)I'd like to fix this.