jackwener/OpenCLI · error · EmptyResultError

reuters article-detail

Error message

reuters article-detail

What it means

The command throws EmptyResultError('reuters article-detail', ...) when mapArticleDetail produced no usable detail — neither a title nor a body. The page technically rendered, but extraction found no article content, which the library attributes to a paywall or a non-article URL.

Source

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

        }
        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. Confirm the URL is a direct article permalink, not a section/topic page
  2. Try another article to distinguish URL-specific vs systemic issues
  3. Authenticate (auth login) to rule out soft paywall stripping the body
  4. Report a bug if valid article pages consistently yield empty results

Example fix

// before
reuters article-detail "https://www.reuters.com/world/us/"   # section page -> EmptyResultError
// after
reuters article-detail "https://www.reuters.com/world/us/specific-article-slug-2026-08-29/"
Defensive patterns

Strategy: fallback

Validate before calling

// check the URL looks like an article permalink (slug + id), not a section page
if (!/reuters\.\w+\/[\w-]+\/[\w-]+\/[\w-]+-\d{4}-\d{2}-\d{2}\//.test(url)) {
  console.warn('URL does not look like an article permalink');
}

Type guard

null

Try / catch

try {
  return await reutersArticleDetail(url);
} catch (e) {
  if (e instanceof EmptyResultError || /no article body/.test(String(e.message))) {
    console.warn('No article content — URL may be a section page or paywalled');
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: The page evaluates successfully and passes the payload checks, but the mapped detail has empty title and body — e.g. the URL is a section/listing page, a removed article stub, or a consent shell that renders no article DOM.

Common situations: Pointing the command at a reuters.com section page or author page instead of an article; the article was deleted so only a stub renders; a client-side paywall stripping body content before the script runs.

Related errors


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