{"record":{"id":"9dfab5046963e010","repo":"jackwener/OpenCLI","slug":"reuters-article-detail-returned-no-payload","errorCode":null,"errorMessage":"Reuters article-detail returned no payload","messagePattern":"Reuters article-detail returned no payload","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/reuters/article-detail.js","lineNumber":42,"sourceCode":"    func: async (page, kwargs) => {\n        const url = String(kwargs.url || '').trim();\n        if (!url) {\n            throw new ArgumentError('Article URL cannot be empty');\n        }\n        if (!REUTERS_HOST.test(url)) {\n            throw new ArgumentError(`URL must be on reuters.com, got ${url}`);\n        }\n        await page.goto(url);\n        await page.wait(2);\n        const result = await page.evaluate(buildArticleDetailScript());\n        if (result?.error) {\n            throw new CommandExecutionError(`Reuters article-detail failed inside the page: ${result.error}`);\n        }\n        if (result?.authRequired) {\n            throw new AuthRequiredError('www.reuters.com', 'Reuters article-detail is gated by login, subscription, or human verification');\n        }\n        if (!result || result.ok !== true) {\n            throw new CommandExecutionError(\n                'Reuters article-detail returned no payload',\n                'Check that the URL points to a Reuters article and that the page loaded',\n            );\n        }\n        const detail = mapArticleDetail(result.body?.article, result.body?.bodyText, url);\n        if (!detail || (!detail.title && !detail.body)) {\n            throw new EmptyResultError('reuters article-detail', 'Page rendered no article body — likely paywalled or a non-article URL');\n        }\n        return [detail];\n    },\n});\n","sourceCodeStart":24,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/reuters/article-detail.js#L24-L54","documentation":"The command throws CommandExecutionError('Reuters article-detail returned no payload') when the in-page script completed but result is null/undefined or result.ok !== true and no more specific error (page error, authRequired) was set. It guards against the scraper silently producing nothing usable.","triggerScenarios":"page.evaluate returns null/undefined (script did not run or returned nothing) or returns an object whose ok flag is not exactly true, without setting error or authRequired.","commonSituations":"Page loaded a soft interstitial the script did not classify; script returned an unexpected shape after a Reuters frontend update; evaluate serialization dropped the result; navigation raced with page.wait(2) and content was still loading.","solutions":["Retry — timing/interstitial issues often resolve on another attempt","Increase dwell time or re-run while the page is fully settled if you control the wrapper","Verify the URL is a genuine reuters.com article","Report a bug with the URL if it reproduces consistently"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  return await reutersArticleDetail(url);\n} catch (e) {\n  if (String(e.message).includes('returned no payload')) {\n    await sleep(3000);\n    return await reutersArticleDetail(url); // one retry for slow loads/interstitials\n  }\n  throw e;\n}","preventionTips":["Allow pages to fully settle before scraping","Retry once on empty-payload errors","Validate the URL is an article, not a shell page","Track recurrence to detect Reuters frontend changes"],"tags":["scraping","browser","empty-result"],"backgroundTag":"page-scrape-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}