{"record":{"id":"5f53912d0d898595","repo":"jackwener/OpenCLI","slug":"command-returned-no-results","errorCode":null,"errorMessage":"${command} returned no results","messagePattern":"(.+?) returned no results","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/dribbble/utils.js","lineNumber":72,"sourceCode":"    try {\n        url = new URL(target);\n    } catch {\n        throw new ArgumentError('shot must be a numeric id or dribbble.com/shots URL');\n    }\n    if (!/(^|\\.)dribbble\\.com$/i.test(url.hostname)) {\n        throw new ArgumentError('shot URL must use dribbble.com');\n    }\n    const match = url.pathname.match(/^\\/shots\\/(\\d+)(?:-|\\/|$)/);\n    if (!match) throw new ArgumentError('shot URL must match dribbble.com/shots/<id>');\n    return match[1];\n}\n\nexport function requireRows(payload, command) {\n    if (!payload || typeof payload !== 'object') {\n        throw new CommandExecutionError(`${command} returned an unreadable browser payload`);\n    }\n    if (payload.empty) {\n        throw new EmptyResultError(command, payload.reason || `${command} returned no results`);\n    }\n    if (!payload.ok) {\n        const reason = payload.reason ? `: ${payload.reason}` : '';\n        throw new CommandExecutionError(`${command} selector drift${reason}`);\n    }\n    if (!Array.isArray(payload.rows)) {\n        throw new CommandExecutionError(`${command} returned a malformed rows payload`);\n    }\n    if (payload.rows.length === 0) {\n        throw new EmptyResultError(command, `${command} page loaded but no matching rows were found`);\n    }\n    return payload.rows;\n}\n\nexport function requireRow(payload, command) {\n    if (!payload || typeof payload !== 'object') {\n        throw new CommandExecutionError(`${command} returned an unreadable browser payload`);\n    }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dribbble/utils.js#L54-L90","documentation":"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.","triggerScenarios":"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.","commonSituations":"A misspelled designer or search term, a designer account with no public shots, or overly narrow filters that exclude all rows.","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."],"exampleFix":"// before\nconst rows = cli.rows('shots', payload); // throws on empty\n\n// after\nlet rows = [];\ntry {\n  rows = cli.rows('shots', payload);\n} catch (e) {\n  if (e instanceof EmptyResultError) rows = [];\n  else throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (payload && payload.empty) {\n  console.log('No results expected for this query:', payload.reason || 'none');\n}","typeGuard":"function isEmptyResult(p) {\n  return p != null && typeof p === 'object' && p.empty === true;\n}","tryCatchPattern":"try {\n  rows = requireRows(payload, 'shots');\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    rows = []; // treat as zero rows, not a failure\n  } else throw e;\n}","preventionTips":["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."],"tags":["empty-results","no-data","scraping"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}