jackwener/OpenCLI · error · CommandExecutionError
Bilibili creator comparison request failed: ${detail}
Error message
Bilibili creator comparison request failed: ${detail} What it means
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.
Source
Thrown at clis/bilibili/creator-stats.js:89
return requirePayload(payload);
}
catch (error) {
if (
error instanceof AuthRequiredError
|| error instanceof EmptyResultError
|| error instanceof CommandExecutionError
|| error instanceof TimeoutError
) {
throw error;
}
const detail = `${error?.message ?? error} ${error?.hint ?? ''}`.trim();
if (/abort|timed?\s*out|timeout/i.test(detail)) {
throw new TimeoutError('Bilibili creator comparison', FETCH_TIMEOUT_SECONDS);
}
if (/HTTP\s+(401|403)|登录|passport|\/login\b/i.test(detail)) {
throw new AuthRequiredError('member.bilibili.com', `Bilibili creator-center login is required: ${detail}`);
}
throw new CommandExecutionError(`Bilibili creator comparison request failed: ${detail}`);
}
}
function selectTarget(list, bvid) {
const matches = [];
for (const item of list) {
if (!isRecord(item) || typeof item.bvid !== 'string' || !/^BV[0-9A-Za-z]{10}$/.test(item.bvid)) {
throw new CommandExecutionError('Bilibili creator comparison returned a malformed manuscript row');
}
if (item.bvid === bvid) matches.push(item);
}
if (matches.length > 1) {
throw new CommandExecutionError(`Bilibili creator comparison returned duplicate rows for ${bvid}`);
}
if (matches.length === 0) {
throw new EmptyResultError(
`bilibili creator-stats ${bvid}`,
'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.',View on GitHub (pinned to 49907e53dc)
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
Defensive patterns
Strategy: fallback
Try / catch
try {
const rows = await runCommand();
} catch (e) {
if (/request failed/.test(e.message)) {
// inspect embedded detail (DNS/TLS/HTTP); fall back to a cached result or retry
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: No internet / DNS failure; Bilibili returning 500/502 during incidents; captive portal or proxy injecting HTML; firewall blocking member.bilibili.com.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- ${label} failed: ${detail}
- arXiv API HTTP ${resp.status}
- Bilibili creator comparison API returned a malformed envelop
- Bilibili creator comparison
- 获取视频分P信息失败: ${error?.message || error}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c3aacbd3943c444e.
Report an issue: GitHub.