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 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-20 20:02:55 -05:00
parent f1ca14791d
commit 46fdde3d02

View File

@ -533,7 +533,7 @@ def get_pitching_peripherals(season: int):
row_data.append(player_id) row_data.append(player_id)
if len(headers) == 0: if len(headers) == 0:
col_names.append("key_bbref") col_names.append("key_bbref")
except Exception: except KeyError:
pass pass
row_data.append(cell.text) row_data.append(cell.text)
if len(headers) == 0: if len(headers) == 0: