fix: season-stats update-game returns 404 for nonexistent game_id #117

Merged
cal merged 1 commits from ai/paper-dynasty-database#113 into next-release 2026-03-19 18:18:41 +00:00

1 Commits

Author SHA1 Message Date
Cal Corum
3fc6721d4d fix: catch DoesNotExist and return 404 for nonexistent game_id
Closes #113

Adds a specific `DoesNotExist` handler before the generic `Exception`
block in `update_game_season_stats`. Peewee's `DoesNotExist` (raised
when `StratGame.get_by_id(game_id)` finds no row) previously bubbled
through to the `except Exception` handler which included raw SQL and
params in the 500 detail string. Now returns a clean 404.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 12:01:46 -05:00