diff --git a/app/routers_v2/season_stats.py b/app/routers_v2/season_stats.py index eb87e59..65dd787 100644 --- a/app/routers_v2/season_stats.py +++ b/app/routers_v2/season_stats.py @@ -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(