{"record":{"id":"0c5ab2ab3f56880a","repo":"jackwener/OpenCLI","slug":"reuters-search","errorCode":null,"errorMessage":"reuters search","messagePattern":"reuters search","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/reuters/search.js","lineNumber":59,"sourceCode":"                `Reuters search requires an accessible Reuters browser session or completed human verification${result.status ? ` (HTTP ${result.status})` : ''}`,\n            );\n        }\n        if (result.ok !== true) {\n            const status = Number.isFinite(result.status) && result.status > 0\n                ? `HTTP ${result.status}${result.statusText ? ` ${result.statusText}` : ''}`\n                : 'no upstream response';\n            throw new CommandExecutionError(`Reuters search API failed (${status})`);\n        }\n        if (!result.body) {\n            const detail = result.parseError ? `: ${result.parseError}` : '';\n            throw new CommandExecutionError(\n                `Reuters search returned a non-JSON body${detail}`,\n                'Open www.reuters.com in your browser and clear any challenge before retrying.',\n            );\n        }\n        const rows = mapSearchArticles(result.body, limit);\n        if (!rows.length) {\n            throw new EmptyResultError('reuters search', `No articles matched \"${query}\". Try broadening the query.`);\n        }\n        return rows;\n    },\n});\n","sourceCodeStart":41,"sourceCodeEnd":64,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/reuters/search.js#L41-L64","documentation":"EmptyResultError with source 'reuters search'. The search executed successfully and the JSON body parsed, but mapSearchArticles produced zero rows for the query — i.e. Reuters legitimately returned no matching articles. This is a no-data signal, not a failure of the request pipeline.","triggerScenarios":"result.body parsed fine but contained no articles mappable by mapSearchArticles(body, limit) — an overly specific query, unusual filters, or a response shape whose article list sits at a different key.","commonSituations":"Very narrow queries (rare names, long phrases); misspelled search terms; limit parsing fine but zero hits; a Reuters API response-format change causing the mapper to find no articles even when they exist.","solutions":["Broaden the query — shorter terms, fewer words, or alternate spellings (as the error message itself suggests).","Try a known-popular keyword (e.g. 'markets') to confirm the pipeline works and the issue is the query.","If even broad queries return nothing, verify mapSearchArticles against the current Reuters response format in clis/reuters/utils.js.","Check Reuters search in a regular browser for the same query to confirm there are genuinely no results."],"exampleFix":"// before\nconst rows = await cli.run('reuters search', { query: 'Q3 lithium carbonate futures arbitrage Belgium' });\n// after\nconst rows = await cli.run('reuters search', { query: 'lithium' });","handlingStrategy":"fallback","validationCode":"// sanity-check the query before invoking\nconst q = String(query || '').trim();\nif (q.length < 3) throw new Error('Query too narrow/short for Reuters search — broaden it first');","typeGuard":"function hasRows(rows) { return Array.isArray(rows) && rows.length > 0; }","tryCatchPattern":"try {\n  rows = await cli.run('reuters search', { query });\n} catch (e) {\n  if (e instanceof EmptyResultError || e.name === 'EmptyResultError') {\n    rows = []; // or fall back to a broader query\n  } else throw e;\n}","preventionTips":["Prefer short, broad keywords over long phrases.","Provide fallback queries (synonyms, ticker symbols) when automating.","Distinguish EmptyResultError from pipeline failures so empty results don't trigger retries.","If broad queries also return empty, audit mapSearchArticles against the live response format."],"tags":["empty-results","search","query"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}