From 46fdde3d020e4c8810a534a64ccd1deb6237fc21 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 20 Mar 2026 20:02:55 -0500 Subject: [PATCH] fix: narrow swallowed exception in get_pitching_peripherals() (#10) Closes #10 Replace `except Exception: pass` with `except KeyError: pass` so only the expected missing-attribute case (`cell["data-append-csv"]` not present) is silently skipped. Network errors, encoding issues, and other unexpected exceptions will now propagate instead of being hidden. Co-Authored-By: Claude Sonnet 4.6 --- creation_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/creation_helpers.py b/creation_helpers.py index f1081e0..e181a11 100644 --- a/creation_helpers.py +++ b/creation_helpers.py @@ -533,7 +533,7 @@ def get_pitching_peripherals(season: int): row_data.append(player_id) if len(headers) == 0: col_names.append("key_bbref") - except Exception: + except KeyError: pass row_data.append(cell.text) if len(headers) == 0: