Narrow swallowed exception in get_pitching_peripherals() HTML parsing #10

Closed
opened 2026-02-20 06:52:56 +00:00 by cal · 1 comment
Owner

creation_helpers.py:808-809except Exception as e: pass. Should catch KeyError specifically, not all exceptions including network timeouts, encoding errors, or structural changes in page layout.

Priority: low | Labels: bug, tech-debt

`creation_helpers.py:808-809` — `except Exception as e: pass`. Should catch `KeyError` specifically, not all exceptions including network timeouts, encoding errors, or structural changes in page layout. **Priority**: low | **Labels**: bug, tech-debt
Claude added the
ai-working
label 2026-03-21 01:01:06 +00:00
Claude added
ai-pr-opened
and removed
ai-working
labels 2026-03-21 01:03:13 +00:00
Collaborator

Fixed in PR #35: #35

Changed except Exception: passexcept KeyError: pass at creation_helpers.py:536. The try/except wraps a dict-key lookup on a BeautifulSoup element (cell["data-append-csv"]), so KeyError is the only expected exception. Network and encoding errors will now propagate instead of being silently swallowed.

Fixed in PR #35: https://git.manticorum.com/cal/paper-dynasty-card-creation/pulls/35 Changed `except Exception: pass` → `except KeyError: pass` at `creation_helpers.py:536`. The try/except wraps a dict-key lookup on a BeautifulSoup element (`cell["data-append-csv"]`), so `KeyError` is the only expected exception. Network and encoding errors will now propagate instead of being silently swallowed.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-card-creation#10
No description provided.