fix: normalize snapshot read failures to unavailable in slots RPC path

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-08-25 12:25:39 +00:00
committed by GitHub
co-authored by genichin
parent f394f1560d
commit d4a968ee1a
3 changed files with 77 additions and 3 deletions
+10 -1
View File
@@ -49,6 +49,7 @@ class AccountSnapshotUnavailable(RuntimeError):
"account_mismatch",
"expired",
"live_read_failed",
"read_failed",
})
def __init__(self, code: str) -> None:
@@ -189,7 +190,15 @@ class AccountSnapshotService:
account_hash = self._broker.account_scope_hash()
if not account_hash:
raise AccountSnapshotUnavailable("account_mismatch")
snapshot = self._store.load(account_hash)
try:
snapshot = self._store.load(account_hash)
except Exception as exc:
_log.warning(
"account snapshot load failed: account_hash=%s",
account_hash,
exc_info=True,
)
raise AccountSnapshotUnavailable("read_failed") from exc
if snapshot is None or snapshot.account_hash != account_hash:
raise AccountSnapshotUnavailable("account_mismatch")
return snapshot