{"record":{"id":"70db001af6e98aa7","repo":"jackwener/OpenCLI","slug":"label-request-failed-err-message-err-70db00","errorCode":null,"errorMessage":"${label} request failed: ${err?.message ?? err}","messagePattern":"(.+?) request failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/dblp/utils.js","lineNumber":41,"sourceCode":" */\nconst KEY_PATTERN = /^[a-z]+(?:\\/[A-Za-z0-9_.-]+)+$/;\n\n/**\n * Wraps `fetch` with typed errors. We always set a UA per dblp's\n * polite-fetch guidance (https://dblp.org/faq/How+to+use+the+dblp+search+API.html).\n */\nasync function dblpFetch(url, label, accept) {\n    let res;\n    try {\n        res = await fetch(url, {\n            headers: {\n                accept,\n                'user-agent': 'opencli-dblp/1.0 (+https://github.com/jackwener/opencli)',\n            },\n        });\n    }\n    catch (err) {\n        throw new CommandExecutionError(`${label} request failed: ${err?.message ?? err}`, 'Check that dblp.org is reachable from this network.');\n    }\n    if (!res.ok) {\n        if (res.status === 429) {\n            throw new CommandExecutionError(`${label} returned HTTP 429 (rate limited)`, 'dblp throttles clients that fetch too aggressively. Wait a few seconds and retry, or lower --limit.');\n        }\n        if (res.status === 404) {\n            throw new EmptyResultError(label, 'dblp returned 404 — the requested record may not exist.');\n        }\n        throw new CommandExecutionError(`${label} returned HTTP ${res.status}`, 'Inspect the response in a browser at the same URL for more context.');\n    }\n    return res;\n}\n\nexport async function dblpFetchJson(path, label) {\n    const res = await dblpFetch(`${DBLP_ORIGIN}${path}`, label, 'application/json');\n    let body;\n    try {\n        body = await res.json();","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dblp/utils.js#L23-L59","documentation":"CommandExecutionError thrown by dblpFetch when the underlying HTTP request to dblp.org itself fails (fetch rejects) — DNS failure, connection refused/reset, TLS error, timeout. The error message wraps the original err.message with the request label for context.","triggerScenarios":"Any dblp subcommand (author, paper, search) while the network request throws: no internet, DNS failure, firewall/proxy blocking dblp.org, TLS interception, or dblp.org outage.","commonSituations":"Working offline; corporate proxy blocking dblp.org; VPN or DNS misconfiguration; dblp.org downtime; IPv6 connectivity issues in the runtime.","solutions":["Check general internet connectivity (e.g. curl https://dblp.org in a terminal)","Check the wrapped err.message in the error for the root cause (ENOTFOUND, ECONNREFUSED, timeout)","Configure proxy env vars (HTTPS_PROXY) if behind a corporate proxy","Retry later if dblp.org is down (check status/downdetector)","If Node's fetch has TLS issues, verify CA/certificate setup"],"exampleFix":"// before\nopencli dblp search 'transformers'   # offline\n// Error: dblp search request failed: fetch failed\n// after\n# connect to network / set proxy, then\nexport HTTPS_PROXY=http://proxy.corp:8080\nopencli dblp search 'transformers'","handlingStrategy":"retry","validationCode":"// Optionally pre-check reachability before the real call.\nconst probe = await fetch('https://dblp.org', { method: 'HEAD' }).catch(() => null);\nif (!probe) throw new Error('dblp.org unreachable — check network/proxy');","typeGuard":null,"tryCatchPattern":"try {\n  rows = await dblpSearch({ query });\n} catch (err) {\n  if (/request failed/.test(err.message)) {\n    await sleep(1000);\n    rows = await dblpSearch({ query }); // retry once after transient network issue\n  } else throw err;\n}","preventionTips":["Set HTTPS_PROXY in restricted/corporate networks","Add retry-with-backoff around all dblp calls","Monitor connectivity/DNS in CI environments before runs","Check dblp.org status when errors cluster in time"],"tags":["dblp","network","http-request"],"backgroundTag":"network-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}