{"record":{"id":"6e55cefd9ff85bbb","repo":"jackwener/OpenCLI","slug":"google-images","errorCode":"google images","errorMessage":"No Google image results matched \"${query}\".","messagePattern":"No Google image results matched \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/google/images.js","lineNumber":378,"sourceCode":"        if (!imageUrl || !sourceUrl || isGoogleInternalResultUrl(sourceUrl)) {\n            throw new CommandExecutionError('google images returned a result row without stable external image/source identity.');\n        }\n        const source = String(row[4] || '').trim() || new URL(sourceUrl).hostname.replace(/^www\\./, '');\n        const title = String(row[0] || '').trim() || source;\n        return {\n            rank: index + 1,\n            title,\n            imageUrl,\n            thumbnailUrl,\n            sourceUrl,\n            source,\n            width: Number.isFinite(Number(row[5])) ? Number(row[5]) : null,\n            height: Number.isFinite(Number(row[6])) ? Number(row[6]) : null,\n        };\n    });\n\n    if (rows.length === 0) {\n        throw new EmptyResultError('google images', `No Google image results matched \"${query}\".`);\n    }\n    return rows;\n}\n\nasync function evaluateGoogleImagesPageState(page) {\n    const raw = await page.evaluate(inspectGoogleImagesPage);\n    const state = unwrapBrowserResult(raw);\n    if (!state || typeof state !== 'object' || Array.isArray(state)) {\n        throw new CommandExecutionError('google images returned an unexpected page-state payload shape.');\n    }\n    return state;\n}\n\nasync function evaluateGoogleImageRows(page, limit, resolveOriginal) {\n    let rows = [];\n    for (let attempt = 0; attempt < 6; attempt += 1) {\n        const raw = await page.evaluate(extractGoogleImageRows, limit, resolveOriginal);\n        rows = requireRows(raw, 'google images');","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/google/images.js#L360-L396","documentation":"EmptyResultError (code `google images`) thrown by `normalizeImageRows` when every raw row was filtered out (or none were provided), leaving `rows.length === 0` after slicing to the limit. The command guarantees at least one result or raises this user-facing message including the query.","triggerScenarios":"Calling `google images <query>` where the page extraction returned zero usable rows: the query genuinely has no image matches, the results hadn't rendered when the script ran, or all candidate rows failed the shape/URL filters (errors 1616/1617 were per-row fatal; here rows can also be absent entirely).","commonSituations":"Very obscure or nonsense queries; safe-search filtering out all results; slow network where images grid hasn't painted; Google serving a CAPTCHA/consent page with no image grid.","solutions":["Rephrase or broaden the query and re-run.","Retry after a delay if the page may have been slow to render.","Check a browser for the same query — if a CAPTCHA/consent page appears, resolve it or change IP/locale.","Handle EmptyResultError as a normal no-results outcome in your pipeline."],"exampleFix":"// before\nopencli run google images \"qzxv nonexisting thing 12345\"\n// after\nopencli run google images \"golden retriever puppy\"","handlingStrategy":"try-catch","validationCode":"if (!query || query.trim().length === 0) {\n  console.warn('Empty query will yield EmptyResultError from google images.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  rows = await run('google images', query);\n} catch (e) {\n  if (e.name === 'EmptyResultError') return []; // no image matches\n  throw e;\n}","preventionTips":["Use common searchable terms; avoid nonsense queries.","Retry after a delay if the page may have rendered slowly.","Treat EmptyResultError as expected for niche queries."],"tags":["scraping","google-images","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}