{"record":{"id":"e2fd5ed0cb99cbd9","repo":"jackwener/OpenCLI","slug":"coingecko-categories-request-failed-err-messag","errorCode":null,"errorMessage":"coingecko categories request failed: ${err?.message ?? err}","messagePattern":"coingecko categories request failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/coingecko/categories.js","lineNumber":44,"sourceCode":"            throw new ArgumentError(\n                `coingecko sort \"${args.sort}\" is not supported`,\n                `Supported sorts: ${ORDER_OPTIONS.join(', ')}`,\n            );\n        }\n        const limit = Number(args.limit ?? 20);\n        if (!Number.isInteger(limit) || limit <= 0) {\n            throw new ArgumentError('coingecko limit must be a positive integer');\n        }\n        if (limit > 100) {\n            throw new ArgumentError('coingecko limit must be <= 100');\n        }\n        const url = `https://api.coingecko.com/api/v3/coins/categories?order=${encodeURIComponent(sort)}`;\n        let resp;\n        try {\n            resp = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0' } });\n        }\n        catch (err) {\n            throw new CommandExecutionError(`coingecko categories request failed: ${err?.message ?? err}`);\n        }\n        if (resp.status === 429) {\n            throw new CommandExecutionError(\n                'coingecko returned HTTP 429 (rate limited)',\n                'Free tier allows ~30 calls/min. Wait and retry.',\n            );\n        }\n        if (!resp.ok) {\n            throw new CommandExecutionError(`coingecko categories returned HTTP ${resp.status}`);\n        }\n        let data;\n        try {\n            data = await resp.json();\n        }\n        catch (err) {\n            throw new CommandExecutionError(`coingecko categories returned malformed JSON: ${err?.message ?? err}`);\n        }\n        if (!Array.isArray(data) || !data.length) {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/coingecko/categories.js#L26-L62","documentation":"The fetch to https://api.coingecko.com/api/v3/coins/categories threw (network-level failure), and the CLI wraps it in a CommandExecutionError including the underlying error message. This happens before any HTTP status is available.","triggerScenarios":"DNS failure, no network connection, TLS errors, connection refused/timeouts, or a proxy blocking api.coingecko.com from clis/coingecko/categories.js.","commonSituations":"Running the CLI behind a corporate proxy; offline or flaky network; firewall/VPN blocking CoinGecko; Node runtime without network access (sandboxed CI).","solutions":["Check network connectivity and retry the command","Verify DNS/proxy settings (HTTPS_PROXY etc.) allow api.coingecko.com","Retry later — the error message contains the underlying cause to diagnose further"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight connectivity\ntry {\n  await fetch('https://api.coingecko.com/api/v3/ping', { headers: { 'User-Agent': 'Mozilla/5.0' } });\n} catch (e) {\n  throw new Error('No network access to api.coingecko.com: ' + e.message);\n}","typeGuard":"function isNetworkFailure(err) {\n  return err instanceof CommandExecutionError && /fetch failed|ENOTFOUND|ECONNREFUSED|ETIMEDOUT|ECONNRESET/i.test(err.message);\n}","tryCatchPattern":"try {\n  await runCategories(args);\n} catch (err) {\n  if (isNetworkFailure(err)) {\n    await sleep(2000);\n    await runCategories(args); // retry once\n  } else throw err;\n}","preventionTips":["Verify proxy env vars (HTTPS_PROXY/NO_PROXY) are correct in CI","Add timeout + retry with backoff around CLI invocations","Monitor connectivity to api.coingecko.com before batch runs"],"tags":["network","fetch-failed","cli","coingecko"],"backgroundTag":"network-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}