jackwener/OpenCLI · info · EmptyResultError

pubmed review

Error message

pubmed review

What it means

This EmptyResultError ('pubmed review') is thrown when the review-article search completed successfully but matched zero PMIDs. The query was accepted by PubMed; no review-typed articles satisfied it. It is a normal empty result, not an infrastructure problem.

Source

Thrown at clis/pubmed/review.js:54

        const sort = requireChoice(args.sort, ['date', 'relevance'], 'sort', 'date');
        const searchQuery = buildSearchQuery(query, {
            yearFrom,
            yearTo,
            articleType: 'Review',
            hasAbstract: args['has-abstract'],
        });
        const esearch = await eutilsFetch('esearch', {
            term: searchQuery,
            retmax: limit,
            usehistory: 'y',
            sort: sort === 'date' ? 'pub_date' : '',
        }, { label: 'pubmed review' });
        const pmids = esearch?.esearchresult?.idlist;
        if (!Array.isArray(pmids)) {
            throw new CommandExecutionError('pubmed review did not return an id list', 'PubMed ESearch response shape may have changed.');
        }
        if (pmids.length === 0) {
            throw new EmptyResultError('pubmed review', `No review articles matched "${query}".`);
        }
        return fetchSummaryRows(pmids, 'pubmed review summary');
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Broaden the query (drop the most specific term or split into multiple searches)
  2. Remove or widen the date range
  3. Confirm the topic has reviews by searching PubMed manually with the Review filter on
  4. Fall back to the general `pubmed search` command and filter review-like articles yourself

Example fix

// before
clis.pubmedReview({ query: 'CRISPR base editing AND retinitis pigmentosa AND 2025[PDAT]' });
// after
clis.pubmedReview({ query: 'CRISPR base editing' });
Defensive patterns

Strategy: fallback

Validate before calling

// Pre-flight count with the review filter before the full call
const probe = await eutilsFetch('esearch', { term: `${query} AND review[pt]`, retmax: 0 }, { label: 'probe' });
if (Number(probe?.esearchresult?.count ?? 0) === 0) console.warn('No review articles for this query — consider broadening');

Try / catch

try {
  return await clis.pubmedReview({ query, limit });
} catch (e) {
  if (e.name === 'EmptyResultError' && e.scope === 'pubmed review') {
    return clis.pubmedSearch({ query }); // broader fallback search
  }
  throw e;
}

Prevention

When it happens

Trigger: A highly specific query with the review publication-type filter applied (e.g. rare disease plus narrow subheading) that no reviews cover; misspelled terms; an over-restrictive date range combined with the review filter.

Common situations: Searching niche topics expecting reviews that do not exist; combining many ANDed terms; restricting to a single recent year where no review was published; using field tags that conflict with the review filter.

Related errors


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