jackwener/OpenCLI · warning · EmptyResultError
weibo user-posts
Error message
weibo user-posts
What it means
This is the well-formed empty case: the payload is valid, a posts list was observed and no post candidates were seen, but zero valid rows were extracted. The CLI throws EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range') to signal the user simply has no posts matching the query, e.g. no posts within the requested start/end window.
Source
Thrown at clis/weibo/user-posts.js:216
})()
`);
const payload = unwrapEvaluateResult(evaluateResult);
if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {
mapError(payload.error);
}
if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {
throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');
}
const [resolvedUid, rows, sawList, sawPostCandidates] = payload;
if (!sawList && rows.length === 0) {
throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');
}
if (sawPostCandidates && rows.length === 0) {
throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');
}
if (rows.length === 0) {
throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');
}
return rows.slice(0, limit).map((row, index) => ({
rank: index + 1,
id: String(row.id),
mblogid: row.mblogid || '',
author: row.author || '',
uid: String(row.uid || resolvedUid || ''),
text: row.text || '',
time: row.time || '',
reposts: row.reposts ?? 0,
comments: row.comments ?? 0,
likes: row.likes ?? 0,
pic_count: row.pic_count ?? 0,
url: row.url || '',
}));
},
});View on GitHub (pinned to 49907e53dc)
Solutions
- Widen the start/end date range and retry.
- Confirm the account actually posted in the window by checking the profile in a browser.
- Verify the uid corresponds to the intended account (similar numeric ids are easy to mistype).
- Remember dates are interpreted in Asia/Shanghai (+08:00); shift your range if you computed boundaries in another time zone.
Example fix
// before --start 2024-03-01 --end 2024-03-02 // no posts in window // after --start 2024-01-01 --end 2024-03-31 // widened window
Defensive patterns
Strategy: fallback
Validate before calling
if (start && end && start > end) throw new Error('inverted range');
if (start && end && (Date.parse(end) - Date.parse(start)) / 86400000 > 366) {
console.warn('range exceeds one year; consider chunking');
} Try / catch
try {
return await runUserPosts(opts);
} catch (err) {
if (err instanceof EmptyResultError) {
return []; // treat as legitimate 'no posts in range'
}
throw err;
} Prevention
- Treat EmptyResultError as expected data emptiness, not a bug.
- Verify the uid maps to the intended account.
- Remember dates are Asia/Shanghai (+08:00) — shift ranges computed in UTC/local time.
- Widen date windows for low-activity accounts.
When it happens
Trigger: Querying a user who posted nothing in the given date range, a range entirely before the account's first post or after its last, an overly restrictive limit/filter, or a user whose posts are all hidden/deleted.
Common situations: Narrow date windows around inactive periods, querying archived/suspended accounts, or time-zone off-by-one where the Shanghai date window excludes expected posts.
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
- weibo delete
- weibo favorites
- No prices returned for train_no=${trainNo} ${fromStation.nam
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/bcaf0602e50c815d.
Report an issue: GitHub.