{"record":{"id":"78967c6b278119fa","repo":"jackwener/OpenCLI","slug":"command-was-not-found","errorCode":null,"errorMessage":"${command} was not found","messagePattern":"(.+?) was not found","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/dribbble/utils.js","lineNumber":92,"sourceCode":"    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    }\n    if (payload.empty) {\n        throw new EmptyResultError(command, payload.reason || `${command} was not found`);\n    }\n    if (!payload.ok || !payload.row) {\n        const reason = payload.reason ? `: ${payload.reason}` : '';\n        throw new CommandExecutionError(`${command} selector drift${reason}`);\n    }\n    return payload.row;\n}\n\nexport async function runBrowserTask(label, task) {\n    try {\n        return await task();\n    } catch (error) {\n        if (TYPED_ERROR_CODES.has(error?.code)) throw error;\n        throw new CommandExecutionError(`${label} failed: ${error?.message ?? error}`);\n    }\n}\n\nexport function extractShotRows(limit) {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dribbble/utils.js#L74-L110","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Double-check the identifier (username/shot id/slug) passed to the command","Open the URL manually in a browser to confirm the item exists and is public","Catch EmptyResultError and present a 'not found' message instead of retrying","If the item should exist, check for login/anti-bot walls that make the page render empty"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate identifiers\nif (!/^[a-z0-9-]+$/i.test(username)) throw new Error('invalid dribbble username');","typeGuard":"function isEmptyResult(p) {\n  return p != null && typeof p === 'object' && p.empty === true;\n}","tryCatchPattern":"try {\n  const row = requireRow(payload, 'dribbble shot');\n} catch (err) {\n  if (err?.code === 'EMPTY_RESULT') return null; // not found\n  throw err;\n}","preventionTips":["Treat EMPTY_RESULT as expected for user-supplied identifiers","Confirm slugs/usernames before calling","Cache known-good identifiers to avoid repeated not-found lookups"],"tags":["empty-result","not-found","scraping"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}