fix(gameplay): replace bare except with NoResultFound in cache-miss paths #163

Merged
cal merged 1 commits from autonomous/fix-gameplay-queries-bare-except into main 2026-04-12 14:42:20 +00:00

1 Commits

Author SHA1 Message Date
Cal Corum
687cdad97f fix(gameplay): replace bare except with NoResultFound in cache-miss paths
All checks were successful
Ruff Lint / lint (pull_request) Successful in 18s
In gameplay_queries.py, 10 try/except blocks used `except Exception:` to
detect SQLModel row-not-found cache misses (.one() returning no result).
This silently swallowed connection failures, attribute errors, and
programming bugs on the gameplay hot path.

Narrowed each handler to `except NoResultFound:` (sqlalchemy.exc).
Real errors now propagate instead of being misinterpreted as cache misses.

Refs: autonomous-pipeline finding analyst-2026-04-10-003
Category: stability / error_handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 14:41:24 +00:00