jackwener/OpenCLI · error · CommandExecutionError

Reuters article-detail returned no payload

Error message

Reuters article-detail returned no payload

What it means

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.

Source

Thrown at clis/reuters/article-detail.js:42

    func: async (page, kwargs) => {
        const url = String(kwargs.url || '').trim();
        if (!url) {
            throw new ArgumentError('Article URL cannot be empty');
        }
        if (!REUTERS_HOST.test(url)) {
            throw new ArgumentError(`URL must be on reuters.com, got ${url}`);
        }
        await page.goto(url);
        await page.wait(2);
        const result = await page.evaluate(buildArticleDetailScript());
        if (result?.error) {
            throw new CommandExecutionError(`Reuters article-detail failed inside the page: ${result.error}`);
        }
        if (result?.authRequired) {
            throw new AuthRequiredError('www.reuters.com', 'Reuters article-detail is gated by login, subscription, or human verification');
        }
        if (!result || result.ok !== true) {
            throw new CommandExecutionError(
                'Reuters article-detail returned no payload',
                'Check that the URL points to a Reuters article and that the page loaded',
            );
        }
        const detail = mapArticleDetail(result.body?.article, result.body?.bodyText, url);
        if (!detail || (!detail.title && !detail.body)) {
            throw new EmptyResultError('reuters article-detail', 'Page rendered no article body — likely paywalled or a non-article URL');
        }
        return [detail];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry — timing/interstitial issues often resolve on another attempt
  2. Increase dwell time or re-run while the page is fully settled if you control the wrapper
  3. Verify the URL is a genuine reuters.com article
  4. Report a bug with the URL if it reproduces consistently
Defensive patterns

Strategy: retry

Validate before calling

null

Type guard

null

Try / catch

try {
  return await reutersArticleDetail(url);
} catch (e) {
  if (String(e.message).includes('returned no payload')) {
    await sleep(3000);
    return await reutersArticleDetail(url); // one retry for slow loads/interstitials
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/9dfab5046963e010. Report an issue: GitHub.