fix: replace broad Exception and print() with proper error handling in faces.py

Open Beginner friendly
#1,222 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python, sqlite
Domain
databases

Research direction

Start in faces.py at db_update_face_cluster_ids_batch and inspect how its database errors are handled. Replace the broad exception and print-based message as proposed, adding the module logger; done means sqlite3.Error is handled and the failure is sent through logger.error().

Written by the indexing model from the issue text.

Description

db_update_face_cluster_ids_batch in faces.py has two problems:

  • Uses broad except Exception instead of sqlite3.Error
  • Uses print("Error updating face cluster IDs in batch.") instead of proper logging
Proposed fix
  • Replace except Exception with except sqlite3.Error
  • Replace print() with logger.error()
  • Add import logging and logger = logging.getLogger(__name__)

I'd like to fix this if maintainers agree.

Dominant language
Python
Stars
289
Forks
685
Avg merge
4d 6h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/PictoPy

All issues in AOSSIE-Org/PictoPy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.