jackwener/OpenCLI · error · CommandExecutionError
Sina Finance rolling news request failed: ${error instanceof
Error message
Sina Finance rolling news request failed: ${error instanceof Error ? error.message : String(error)} What it means
CommandExecutionError wrapping a network-level failure of the fetch() call for the rolling news endpoint. The original error message (DNS failure, connection refused, timeout, TLS error) is interpolated. This fires before any HTTP status check, meaning the request never got a response.
Source
Thrown at clis/sinafinance/rolling-news.js:76
domain: 'feed.mix.sina.com.cn',
strategy: Strategy.PUBLIC,
browser: false,
args: [],
columns: ['column', 'title', 'date', 'url'],
func: async () => {
const params = new URLSearchParams({
pageid: '384',
lid: '2519',
k: '',
num: '50',
page: '1',
});
let response;
try {
response = await fetch(`${ROLL_API}?${params}`);
}
catch (error) {
throw new CommandExecutionError(`Sina Finance rolling news request failed: ${error instanceof Error ? error.message : String(error)}`);
}
if (!response.ok) {
throw new CommandExecutionError(`Sina Finance rolling news API returned HTTP ${response.status}`);
}
let payload;
try {
payload = await response.json();
}
catch (error) {
throw new CommandExecutionError(`Sina Finance rolling news API returned invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
}
return normalizeRollRows(payload);
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Check basic internet connectivity (ping/curl another site)
- Verify DNS resolves the Sina API host (nslookup)
- Check firewall/proxy rules allow the Sina finance domain
- Retry with exponential backoff — transient network failures are common
Example fix
// before
try { await cli.rollingNews(); } catch (e) { throw e; }
// after
try {
return await cli.rollingNews();
} catch (e) {
if (String(e.message).includes('request failed')) return retryWithBackoff(cli.rollingNews);
throw e;
} Defensive patterns
Strategy: retry
Validate before calling
// pre-flight connectivity check
const online = await fetch('https://finance.sina.com.cn', { method: 'HEAD' }).then(r => r.ok).catch(() => false);
if (!online) throw new Error('No connectivity to sina.com.cn'); Try / catch
try {
const rows = await cli.rollingNews();
} catch (err) {
if (/request failed/.test(err.message)) {
// network-level failure (DNS/connect/timeout)
return retryWithBackoff(() => cli.rollingNews(), { retries: 3, baseMs: 1000 });
}
throw err;
} Prevention
- Verify DNS and firewall allow finance.sina.com.cn
- Add exponential backoff for transient network errors
- Avoid running from networks that block Chinese finance domains
- Set reasonable timeouts so hangs fail fast and retry
When it happens
Trigger: fetch throws: DNS resolution failure for the Sina host, no network connectivity, connection refused/reset, TLS handshake failure, or request timeout — anything causing fetch to reject.
Common situations: Running the CLI offline or behind a restrictive firewall; DNS misconfiguration; corporate proxies blocking finance.sina.com.cn; intermittent network drops in scheduled jobs.
Related errors
- MiniMax music request failed: ${error?.message ?? error}
- FETCH_ERROR
- archive search request failed: ${error?.message || error}
- archive wayback request failed: ${error?.message || error}
- ${label} request failed: ${err?.message ?? err}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e2366c4bd6e679dc.
Report an issue: GitHub.