{"record":{"id":"c3aacbd3943c444e","repo":"jackwener/OpenCLI","slug":"bilibili-creator-comparison-request-failed-deta","errorCode":null,"errorMessage":"Bilibili creator comparison request failed: ${detail}","messagePattern":"Bilibili creator comparison request failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/bilibili/creator-stats.js","lineNumber":89,"sourceCode":"        return requirePayload(payload);\n    }\n    catch (error) {\n        if (\n            error instanceof AuthRequiredError\n            || error instanceof EmptyResultError\n            || error instanceof CommandExecutionError\n            || error instanceof TimeoutError\n        ) {\n            throw error;\n        }\n        const detail = `${error?.message ?? error} ${error?.hint ?? ''}`.trim();\n        if (/abort|timed?\\s*out|timeout/i.test(detail)) {\n            throw new TimeoutError('Bilibili creator comparison', FETCH_TIMEOUT_SECONDS);\n        }\n        if (/HTTP\\s+(401|403)|登录|passport|\\/login\\b/i.test(detail)) {\n            throw new AuthRequiredError('member.bilibili.com', `Bilibili creator-center login is required: ${detail}`);\n        }\n        throw new CommandExecutionError(`Bilibili creator comparison request failed: ${detail}`);\n    }\n}\n\nfunction selectTarget(list, bvid) {\n    const matches = [];\n    for (const item of list) {\n        if (!isRecord(item) || typeof item.bvid !== 'string' || !/^BV[0-9A-Za-z]{10}$/.test(item.bvid)) {\n            throw new CommandExecutionError('Bilibili creator comparison returned a malformed manuscript row');\n        }\n        if (item.bvid === bvid) matches.push(item);\n    }\n    if (matches.length > 1) {\n        throw new CommandExecutionError(`Bilibili creator comparison returned duplicate rows for ${bvid}`);\n    }\n    if (matches.length === 0) {\n        throw new EmptyResultError(\n            `bilibili creator-stats ${bvid}`,\n            'The manuscript was not present in the latest 100 creator analytics rows; it may be older, not owned by this account, or not analyzed yet.',","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bilibili/creator-stats.js#L71-L107","documentation":"Fallback branch of fetchComparison: any underlying error that is not one of the library's own error types and matches neither the timeout nor the auth regex is rethrown as CommandExecutionError('Bilibili creator comparison request failed: <detail>'). It preserves the original message/hint while normalizing the error type for CLI callers.","triggerScenarios":"page.fetchJson throws non-timeout, non-auth failures — DNS resolution errors, ECONNRESET/ECONNREFUSED, TLS errors, non-JSON (HTML) responses that the fetch layer rejects with a parse error, or HTTP 5xx surfaced as a generic exception.","commonSituations":"No internet / DNS failure; Bilibili returning 500/502 during incidents; captive portal or proxy injecting HTML; firewall blocking member.bilibili.com.","solutions":["Read the appended detail to identify the root cause (DNS, TLS, HTTP status, parse error)","Verify basic connectivity to member.bilibili.com from this machine (browser or curl)","Retry — transient network or server-side (5xx) failures often clear on retry","If the detail indicates a JSON parse failure, log the raw response to check for an anti-bot interstitial or schema change"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const rows = await runCommand();\n} catch (e) {\n  if (/request failed/.test(e.message)) {\n    // inspect embedded detail (DNS/TLS/HTTP); fall back to a cached result or retry\n  } else throw e;\n}","preventionTips":["Verify DNS/connectivity to member.bilibili.com before running","Retry transient network and 5xx errors with backoff","Detect anti-bot HTML interstitials early (non-JSON content-type) and surface a login prompt","Log the embedded detail message — it carries the root cause"],"tags":["bilibili","network","http-error","request-failed"],"backgroundTag":"http-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}