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

View File

@ -52,9 +52,12 @@ async def update_game_season_stats(
raise HTTPException(status_code=401, detail="Unauthorized")
from ..services.season_stats import update_season_stats
from ..db_engine import DoesNotExist
try:
result = update_season_stats(game_id, force=force)
except DoesNotExist:
raise HTTPException(status_code=404, detail=f"Game {game_id} not found")
except Exception as exc:
logger.error("update-game/%d failed: %s", game_id, exc, exc_info=True)
raise HTTPException(