jackwener/OpenCLI · warning · EmptyResultError

${command} was not found

Error message

${command} was not found

What it means

When requireRow sees payload.empty === true, it treats the result as a typed EmptyResultError. The message is either the payload's own reason or the fallback '${command} was not found'. This distinguishes 'the item genuinely does not exist / page reported empty' from selector drift or malformed payloads.

Source

Thrown at clis/dribbble/utils.js:92

    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`);
    }
    if (payload.empty) {
        throw new EmptyResultError(command, payload.reason || `${command} was not found`);
    }
    if (!payload.ok || !payload.row) {
        const reason = payload.reason ? `: ${payload.reason}` : '';
        throw new CommandExecutionError(`${command} selector drift${reason}`);
    }
    return payload.row;
}

export async function runBrowserTask(label, task) {
    try {
        return await task();
    } catch (error) {
        if (TYPED_ERROR_CODES.has(error?.code)) throw error;
        throw new CommandExecutionError(`${label} failed: ${error?.message ?? error}`);
    }
}

export function extractShotRows(limit) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Double-check the identifier (username/shot id/slug) passed to the command
  2. Open the URL manually in a browser to confirm the item exists and is public
  3. Catch EmptyResultError and present a 'not found' message instead of retrying
  4. If the item should exist, check for login/anti-bot walls that make the page render empty
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate identifiers
if (!/^[a-z0-9-]+$/i.test(username)) throw new Error('invalid dribbble username');

Type guard

function isEmptyResult(p) {
  return p != null && typeof p === 'object' && p.empty === true;
}

Try / catch

try {
  const row = requireRow(payload, 'dribbble shot');
} catch (err) {
  if (err?.code === 'EMPTY_RESULT') return null; // not found
  throw err;
}

Prevention

When it happens

Trigger: The browser task for a detail-style command (shot, designer, profile) returned { empty: true } with no reason — e.g. the requested Dribbble item does not exist, was deleted, or the page rendered an empty/not-found state.

Common situations: Fetching a deleted or renamed shot/designer; mistyping a Dribbble username in the command; item is private or region-blocked so the page renders empty.

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/78967c6b278119fa. Report an issue: GitHub.