{"record":{"id":"ee6d666238976f3d","repo":"jackwener/OpenCLI","slug":"label-request-failed-err-message-err-ee6d66","errorCode":null,"errorMessage":"${label} request failed: ${err?.message ?? err}","messagePattern":"(.+?) request failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/steam/utils.js","lineNumber":60,"sourceCode":"    if (!s) {\n        throw new ArgumentError('steam app id is required (e.g. \"620\" for Portal 2)');\n    }\n    if (!/^\\d+$/.test(s)) {\n        throw new ArgumentError(\n            `steam app id \"${value}\" must be a positive integer`,\n            'Copy the numeric id from `steam search` or the URL `store.steampowered.com/app/<id>/`.',\n        );\n    }\n    return s;\n}\n\nexport async function steamFetch(url, label) {\n    let resp;\n    try {\n        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 {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/steam/utils.js#L42-L78","documentation":"steamFetch wraps all HTTP calls to Steam. If fetch itself rejects (network/DNS/TLS failure), it converts the raw error into a CommandExecutionError labeled with the operation name and the underlying message. This gives a consistent, user-facing message for Steam connectivity problems.","triggerScenarios":"Any steamFetch call where the fetch() promise rejects: DNS resolution failure, no internet connection, proxy/VPN blocking store.steampowered.com, TLS errors, or the process being offline.","commonSituations":"Corporate firewalls blocking Steam domains, DNS misconfiguration, IPv6-only or flaky networks, offline CI runners, VPNs routing traffic away from Steam, typos in a custom Steam base URL.","solutions":["Verify network connectivity to store.steampowered.com (curl https://store.steampowered.com)","Check DNS/proxy/VPN settings and corporate firewall rules","Read the wrapped err message for the root cause (ENOTFOUND, ECONNREFUSED, timeout)","Retry after connectivity is restored; use --browser-session mode if available"],"exampleFix":"// before\nawait steamFetch('https://store.steampowered.com/api/appdetails?appids=620', 'app details'); // fails on offline network\n// after\n// reconnect the network / fix proxy, then retry the same call","handlingStrategy":"retry","validationCode":"async function isSteamReachable() { try { await fetch('https://store.steampowered.com', { method: 'HEAD' }); return true; } catch { return false; } }","typeGuard":"null","tryCatchPattern":"try { const data = await steamFetch(url, 'app details'); } catch (e) { if (/request failed/.test(e.message)) { console.error('Steam unreachable, check network/proxy:', e.message); } else throw e; }","preventionTips":["Check connectivity to store.steampowered.com before batch runs","Configure proxy env vars correctly in corporate networks","Avoid VPNs that block Steam domains","Wrap long-running scripts with connectivity checks and retries"],"tags":["network","http","steam"],"backgroundTag":"network-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}