jackwener/OpenCLI · warning · EmptyResultError

No recent papers in ${category}. Check the category name.

Error message

No recent papers in ${category}. Check the category name.

What it means

An EmptyResultError thrown when an arXiv category search returns no entries. The category is first normalized (normalizeArxivCategory) and queried as cat:<category> sorted by submission date; an empty result most often means the category string does not match a real arXiv category. It tells the user to check the category name.

Source

Thrown at clis/arxiv/recent.js:23

    site: 'arxiv',
    name: 'recent',
    access: 'read',
    description: 'List recent arXiv submissions in a category',
    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'category', positional: true, required: true, help: 'arXiv category (e.g. cs.CL, cs.LG, math.PR, q-bio.NC)' },
        { name: 'limit', type: 'int', default: 10, help: 'Max results (max 50)' },
    ],
    columns: ['id', 'title', 'authors', 'published', 'primary_category', 'url'],
    func: async (args) => {
        const category = normalizeArxivCategory(args.category);
        const limit = normalizeArxivLimit(args.limit, 10, 50);
        const query = encodeURIComponent(`cat:${category}`);
        const xml = await arxivFetch(`search_query=${query}&max_results=${limit}&sortBy=submittedDate&sortOrder=descending`);
        const entries = parseEntries(xml);
        if (!entries.length)
            throw new EmptyResultError('arxiv', `No recent papers in ${category}. Check the category name.`);
        return entries.map(e => ({
            id: e.id,
            title: e.title,
            authors: e.authors,
            published: e.published,
            primary_category: e.primary_category,
            url: e.url,
        }));
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check the exact arXiv category identifier, case-sensitive: cs.LG, math.CO, astro-ph.GA at arxiv.org/category_taxonomy
  2. Fix common mistakes: use dashes not dots, correct casing (cs.CV not cs.cv)
  3. Try a broad parent category (cs, math) to confirm the command works, then narrow
  4. Run `opencli arxiv search <keyword>` to find which categories the papers use

Example fix

// before
await exec('opencli arxiv recent cs.ml'); // wrong format
// after
const cat = String(input).trim();
if (!/^[a-z-]+(\.[A-Z]{2})?$/.test(cat)) throw new Error('invalid arXiv category: ' + cat);
await exec('opencli arxiv recent ' + cat.replace(/\./g, (m, i) => i > 0 ? '.' : '.')); // e.g. cs.LG
Defensive patterns

Strategy: validation

Validate before calling

const VALID = /^([a-z-]+)(\.[A-Z]{2})?$/; // e.g. cs, cs.LG, math.CO
const cat = String(category || '').trim();
if (!VALID.test(cat)) throw new Error(`invalid arXiv category: ${cat} (use e.g. cs.LG)`);

Type guard

function isCategoryFormat(s) { return typeof s === 'string' && /^([a-z-]+)(\.[A-Z]{2})?$/.test(s.trim()); }

Try / catch

try {
  return await exec('opencli arxiv recent ' + cat);
} catch (e) {
  if (e.name === 'EmptyResultError') {
    console.error('Check category at arxiv.org/category_taxonomy; is "' + cat + '" correct and current?');
    return [];
  }
  throw e;
}

Prevention

When it happens

Trigger: `opencli arxiv recent <category>` where the cat: query matches no papers — invalid category identifier (e.g. "cs.ml" vs correct "cs.LG"), wrong case, or an obscure category with no recent submissions in scope.

Common situations: Using dots instead of case-sensitive dashes (cs.ml vs cs.LG); inventing category names; arXiv category renames/archives (old categories like astro-ph become astro-ph.CO etc.); typo in the archive specifier.

Related errors


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