Session 19: Sports design overhaul — player cards with headshots, game card redesign, scan page tonight's players, odds diagnostic logging, tier gate utility (1444 tests)

This commit is contained in:
Kev
2026-06-12 00:30:13 -04:00
parent 0e3839a90a
commit 56392ec8f4
12 changed files with 825 additions and 41 deletions
+14 -1
View File
@@ -300,7 +300,20 @@ async function getOdds(sport) {
};
}
// No cache at all
// No cache at all. Session 19 — surface the underlying cause in
// logs so operators can tell odds-api auth failures apart from
// network blips apart from rate-limit responses. The 503 wrapper
// hides everything by design (don't leak details to clients);
// this log gives the operator the signal they need.
const upstreamStatus = err.response && err.response.status;
const upstreamBody = err.response && err.response.data;
console.error(
`[oddsService] ${sport} fetch failed — no cache fallback. ` +
`upstream_status=${upstreamStatus || 'n/a'} ` +
`code=${err.code || 'n/a'} ` +
`message=${err.message} ` +
`upstream_body=${upstreamBody ? JSON.stringify(upstreamBody).slice(0, 200) : 'n/a'}`,
);
if (err.statusCode === 429) throw err;
const serviceError = new Error('Odds service unavailable.');
serviceError.statusCode = 503;