jackwener/OpenCLI · info · EmptyResultError
weixin search
Error message
weixin search
What it means
This is an EmptyResultError with message 'weixin search' (the command name), thrown when the search genuinely completed but returned zero rows AND the payload was flagged empty. It means Sogou had no results for the keyword/page — not a failure of scraping or blocking. The remedy is to change the query or page.
Source
Thrown at clis/weixin/search.js:134
}
catch (error) {
const detail = error instanceof Error ? error.message : String(error);
throw new CommandExecutionError('weixin search failed while loading Sogou results', detail);
}
if (!payload || typeof payload !== 'object' || !Array.isArray(payload.rows)) {
throw new CommandExecutionError('weixin search returned an unreadable browser payload', 'Sogou Weixin may have changed its result page structure.');
}
if (payload.blocked) {
throw new CommandExecutionError('Sogou Weixin blocked this search request', 'Open weixin.sogou.com in Chrome and complete any verification before retrying.');
}
if (payload.invalidCount > 0) {
throw new CommandExecutionError('Sogou Weixin returned article cards without required title or URL', 'The result page structure may have changed; refusing to return a partial result set.');
}
const rows = payload.rows;
if (rows.length === 0 && payload.empty) {
throw new EmptyResultError('weixin search', 'Try a different keyword or a different page number.');
}
if (rows.length === 0) {
throw new CommandExecutionError('weixin search did not expose article result cards', 'Sogou Weixin may have changed its selectors or returned a transient shell page.');
}
return rows.slice(0, limit).map((row, index) => ({
rank: (pageNo - 1) * 10 + index + 1,
page: pageNo,
title: row.title,
url: row.url,
summary: row.summary,
publish_time: row.publish_time,
}));
},
});
export const __test__ = {
MAX_LIMIT,View on GitHub (pinned to 49907e53dc)
Solutions
- Try a different or broader keyword
- Use a lower page number (page 1) to confirm results exist for the term
- Treat it as an expected empty state in batch pipelines and continue to the next keyword
- Check spelling/synonyms of the query
Example fix
// before: assumes rows always
const rows = await search(q);
console.log(rows[0].title);
// after
const rows = await search(q).catch(e => isEmptyResult(e) ? [] : Promise.reject(e));
if (!rows.length) console.log(`no weixin articles for: ${q}`); Defensive patterns
Strategy: fallback
Try / catch
try { rows = await weixinSearch(q); }
catch (e) { if (isEmptyResultError(e)) return []; throw e; } Prevention
- Treat EmptyResultError as expected in batch pipelines
- Validate keywords exist before bulk runs
- Start at page 1 when probing a new keyword
When it happens
Trigger: A keyword with no Weixin article matches; a page number beyond the available result count; very niche misspelled or overly specific queries.
Common situations: Searching long-tail or newly coined terms with no indexed articles; requesting page 5 of a keyword that only has 2 pages of results; automated pipelines iterating query lists that include dead keywords.
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
- 1point3acres thread
- 1point3acres user
- amazon ${definition.commandName} did not expose any ranked i
- amazon search did not expose any product cards
- No posts found in this Band
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a13ed844c25bd27c.
Report an issue: GitHub.