jackwener/OpenCLI · warning · EmptyResultError
${command} returned no results
Error message
${command} returned no results What it means
When the browser payload is well-formed and flagged { empty: true }, requireRows throws an EmptyResultError with payload.reason or the default message '<command> returned no results'. This is the library's normal way of reporting that the page loaded and scraping worked, but nothing matched.
Source
Thrown at clis/dribbble/utils.js:72
try {
url = new URL(target);
} catch {
throw new ArgumentError('shot must be a numeric id or dribbble.com/shots URL');
}
if (!/(^|\.)dribbble\.com$/i.test(url.hostname)) {
throw new ArgumentError('shot URL must use dribbble.com');
}
const match = url.pathname.match(/^\/shots\/(\d+)(?:-|\/|$)/);
if (!match) throw new ArgumentError('shot URL must match dribbble.com/shots/<id>');
return match[1];
}
export function requireRows(payload, command) {
if (!payload || typeof payload !== 'object') {
throw new CommandExecutionError(`${command} returned an unreadable browser payload`);
}
if (payload.empty) {
throw new EmptyResultError(command, payload.reason || `${command} returned no results`);
}
if (!payload.ok) {
const reason = payload.reason ? `: ${payload.reason}` : '';
throw new CommandExecutionError(`${command} selector drift${reason}`);
}
if (!Array.isArray(payload.rows)) {
throw new CommandExecutionError(`${command} returned a malformed rows payload`);
}
if (payload.rows.length === 0) {
throw new EmptyResultError(command, `${command} page loaded but no matching rows were found`);
}
return payload.rows;
}
export function requireRow(payload, command) {
if (!payload || typeof payload !== 'object') {
throw new CommandExecutionError(`${command} returned an unreadable browser payload`);
}View on GitHub (pinned to 49907e53dc)
Solutions
- Treat this as expected empty data: catch EmptyResultError and handle it as a zero-row case, not a failure.
- Broaden the query (remove filters, check spelling of the designer name).
- Inspect payload.reason when available for the scraper's more specific explanation.
Example fix
// before
const rows = cli.rows('shots', payload); // throws on empty
// after
let rows = [];
try {
rows = cli.rows('shots', payload);
} catch (e) {
if (e instanceof EmptyResultError) rows = [];
else throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
if (payload && payload.empty) {
console.log('No results expected for this query:', payload.reason || 'none');
} Type guard
function isEmptyResult(p) {
return p != null && typeof p === 'object' && p.empty === true;
} Try / catch
try {
rows = requireRows(payload, 'shots');
} catch (e) {
if (e instanceof EmptyResultError) {
rows = []; // treat as zero rows, not a failure
} else throw e;
} Prevention
- Check spelling of designer names and search terms before querying.
- Catch EmptyResultError explicitly and model it as an empty list in your app.
- Use payload.reason for logging to distinguish 'no data' from other states.
When it happens
Trigger: Searching a designer with no matching shots, querying a filter/keyword combination with zero hits, or a page that renders an explicit 'no results' state detected by the scraper.
Common situations: A misspelled designer or search term, a designer account with no public shots, or overly narrow filters that exclude all rows.
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
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/5f53912d0d898595.
Report an issue: GitHub.