jackwener/OpenCLI · error · EmptyResultError

rfc rfc

Error message

rfc rfc

What it means

The rfc command throws EmptyResultError when the IETF datatracker responds successfully but returns no metadata (missing doc or doc.name) for the requested RFC. It signals that the lookup completed but produced nothing usable rather than a network failure.

Source

Thrown at clis/rfc/rfc.js:30

    name: 'rfc',
    access: 'read',
    description: 'Single IETF RFC metadata (title, abstract, working group, authors, std level)',
    domain: 'datatracker.ietf.org',
    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'number', positional: true, type: 'int', required: true, help: 'RFC number (e.g. 9000, 791, 2616)' },
    ],
    columns: [
        'rfc', 'title', 'state', 'stdLevel', 'group', 'groupType',
        'pages', 'published', 'authors', 'abstract', 'rfcEditorUrl', 'url',
    ],
    func: async (args) => {
        const number = requireRfcNumber(args.number);
        const name = `rfc${number}`;
        const doc = await rfcFetch(`${RFC_BASE}/doc/${name}/doc.json`, `rfc ${number}`);
        if (!doc || !doc.name) {
            throw new EmptyResultError('rfc rfc', `IETF datatracker returned no metadata for RFC ${number}.`);
        }
        const authors = Array.isArray(doc.authors)
            ? doc.authors.map((a) => String(a?.name ?? '').trim()).filter(Boolean).join(', ')
            : '';
        const groupName = String(doc.group?.name ?? '').trim();
        const groupType = String(doc.group?.type ?? '').trim();
        return [{
            rfc: number,
            title: String(doc.title ?? '').trim(),
            state: String(doc.state ?? '').trim(),
            stdLevel: String(doc.std_level ?? '').trim(),
            group: groupName,
            groupType,
            pages: doc.pages == null ? null : Number(doc.pages),
            published: trimDate(doc.time),
            authors,
            abstract: String(doc.abstract ?? '').trim(),
            rfcEditorUrl: `https://www.rfc-editor.org/rfc/rfc${number}`,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the RFC number exists (e.g. https://datatracker.ietf.org/doc/rfc9000/).
  2. Check for typos in the RFC number.
  3. Retry later if datatracker is having issues; the payload may be transiently incomplete.
  4. Catch EmptyResultError and show a friendly 'no metadata found' message.

Example fix

// before
rfc rfc 9000000
// after
rfc rfc 9000
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
  const doc = await fetchRfcMetadata(number);
} catch (err) {
  if (err instanceof EmptyResultError) {
    console.error(`No metadata found for RFC ${number}: ${err.hint}`);
  } else throw err;
}

Prevention

When it happens

Trigger: Running `rfc rfc <number>` where datatracker returns a 200 JSON body without a name field — e.g. a reserved/never-published RFC number or an unexpected empty doc.json payload.

Common situations: Querying RFC numbers that were never assigned or withdrawn before publication, or a datatracker schema change removing the name field from doc.json.

Related errors


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