{"record":{"id":"20c14a6149b1dcc6","repo":"jackwener/OpenCLI","slug":"label-returned-http-resp-status-20c14a","errorCode":null,"errorMessage":"${label} returned HTTP ${resp.status}","messagePattern":"(.+?) returned HTTP (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/steam/utils.js","lineNumber":75,"sourceCode":"        resp = await fetch(url, { headers: { 'user-agent': UA, accept: 'application/json' } });\n    }\n    catch (err) {\n        throw new CommandExecutionError(\n            `${label} request failed: ${err?.message ?? err}`,\n            'Check that store.steampowered.com is reachable from this network.',\n        );\n    }\n    if (resp.status === 429) {\n        throw new CommandExecutionError(\n            `${label} returned HTTP 429 (rate limited)`,\n            'Steam throttles bursty traffic; wait a few seconds and retry.',\n        );\n    }\n    if (resp.status === 404) {\n        throw new EmptyResultError(label, 'Steam returned 404 — the resource does not exist.');\n    }\n    if (!resp.ok) {\n        throw new CommandExecutionError(`${label} returned HTTP ${resp.status}`);\n    }\n    let body;\n    try {\n        body = await resp.json();\n    }\n    catch (err) {\n        throw new CommandExecutionError(`${label} returned malformed JSON: ${err?.message ?? err}`);\n    }\n    return body;\n}\n\nexport function asString(value) {\n    return value == null ? '' : String(value);\n}\n\nconst HTML_ENTITIES = {\n    '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '\"', '&apos;': \"'\", '&#39;': \"'\", '&nbsp;': ' ',\n};","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/steam/utils.js#L57-L93","documentation":"steamFetch throws a CommandExecutionError for any non-ok HTTP status that is not specifically 429 or 404, reporting the status code with the operation label. This is the generic unexpected-response guard for Steam endpoints.","triggerScenarios":"Steam returning 500/502/503 during outages or maintenance, 403 from edge/CDN blocks, or any other 4xx/5xx outside the specially handled codes.","commonSituations":"Steam store maintenance windows, temporary server-side errors, CDN or bot-protection blocking datacenter IPs, misconstructed request URLs causing 403/410.","solutions":["Retry after a short delay; 5xx errors are usually transient","Check https://steamstat.us for Steam outages or maintenance","Inspect the status code to determine if the block is client-side (403) or server-side (5xx)","Route requests through a different network/IP if a CDN block is suspected"],"exampleFix":"// before\nconst resp = await steamFetch(url, 'app details'); // throws on 503 during maintenance\n// after\n// wrap in retry with backoff for transient 5xx\nlet resp;\nfor (let i = 0; i < 3; i++) {\n  try { resp = await steamFetch(url, 'app details'); break; }\n  catch (e) { if (!/HTTP 5/.test(e.message) || i === 2) throw e; await sleep(2000 * (i + 1)); }\n}","handlingStrategy":"retry","validationCode":"// check Steam service status before bulk jobs\nconst status = await fetch('https://steamstat.us/').then(r => r.text()).catch(() => '');","typeGuard":"null","tryCatchPattern":"try { return await steamFetch(url, label); } catch (e) { const m = /HTTP (\\d+)/.exec(e.message); if (m && m[1] >= 500) { await sleep(3000); return steamFetch(url, label); } throw e; }","preventionTips":["Retry 5xx with backoff; they are usually transient","Monitor steamstat.us during maintenance windows","Avoid datacenter IPs that trigger 403 bot blocks","Log the status code to distinguish client vs server issues"],"tags":["http","server-error","steam"],"backgroundTag":"http-5xx-server-error","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}