jackwener/OpenCLI · warning · EmptyResultError
xueqiu/comments ${symbol}
Error message
xueqiu/comments ${symbol} What it means
When the first comments page is classified 'empty' — the envelope text matches no-data patterns or the list array is present but zero-length — throwFirstPageFailure throws EmptyResultError with resource `xueqiu/comments <symbol>` and message 'No discussion data found for <symbol>'. This is a normal, expected outcome: the query succeeded but there are no discussion posts for that ticker.
Source
Thrown at clis/xueqiu/comments.js:51
return value.trim();
if (typeof value === 'number' && Number.isFinite(value))
return String(value);
return '';
}
function buildPaginationStopMessage(requestNumber, collected, target, reason) {
return `xueqiu comments pagination stopped after request ${requestNumber}, `
+ `collected ${collected}/${target} items, `
+ `reason: ${reason}`;
}
function throwFirstPageFailure(kind, symbol) {
if (kind === 'auth' || kind === 'anti-bot') {
throw new AuthRequiredError('xueqiu.com', 'Stock discussions require login or challenge clearance');
}
if (kind === 'argument') {
throw new ArgumentError(`xueqiu comments received an invalid symbol: ${symbol}`);
}
if (kind === 'empty') {
throw new EmptyResultError(`xueqiu/comments ${symbol}`, `No discussion data found for ${symbol}`);
}
throw new CommandExecutionError(`Unexpected response while loading xueqiu comments for ${symbol}`, 'Run the command again with --verbose to inspect the raw site response.');
}
/**
* Extract the raw item list from one classified JSON payload.
*
* @param json Raw parsed JSON payload from browser fetch.
* @returns Discussion items when the response shape is usable.
*/
export function getCommentItems(json) {
if (!isRecord(json))
return [];
const list = getCommentList(json) ?? [];
return list.filter((item) => !!item && typeof item === 'object');
}
/**
* Classify one raw browser response before command-level error handling.
*View on GitHub (pinned to 49907e53dc)
Solutions
- Confirm the ticker is correct and active on xueqiu.com
- Try a liquid symbol (e.g. SH600519, AAPL) to confirm the command works
- Lower expectations — some stocks genuinely have zero discussions; treat EmptyResultError as success-with-no-rows in scripts
- If a popular stock returns empty, re-login — a degraded session can yield filtered/empty results
Example fix
// before (assuming rows always exist)
const rows = await collectCommentRows(opts);
console.log(rows[0].text);
// after (handle empty)
const rows = await collectCommentRows(opts);
if (rows.length === 0) console.log('No discussions for', opts.symbol); Defensive patterns
Strategy: fallback
Try / catch
try {
const rows = await collectCommentRows(opts);
} catch (e) {
if (e.name === 'EmptyResultError') {
rows = []; // no discussions for this symbol — valid outcome
} else throw e;
} Prevention
- Treat EmptyResultError as a normal no-data outcome in scripts, not a crash
- Check on xueqiu.com whether the stock actually has discussion posts
- Prefer liquid tickers when testing pipelines
- Combine with --limit awareness: sparse symbols return few or zero rows
When it happens
Trigger: `xueqiu comments <symbol>` where xueqiu returns a valid JSON envelope whose list (at json.list or json.data.list) is an empty array, or the envelope says no data / not found / no matching, on the first request.
Common situations: Querying obscure or thinly traded tickers with no discussion posts; querying during quiet market hours for illiquid stocks; a typo that happens to be a valid but nonexistent listing.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No trains found from ${fromStation.name} to ${toStation.name
- NO_DATA
- No Wayback snapshots for "${target}".
- Chess.com has no game archives for ${username}
- Chess.com has games archives for ${username} but no games in
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ec3e0a97768a1cc1.
Report an issue: GitHub.