{"record":{"id":"ce56abe203a5d8b2","repo":"jackwener/OpenCLI","slug":"rfc-rfc","errorCode":null,"errorMessage":"rfc rfc","messagePattern":"rfc rfc","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/rfc/rfc.js","lineNumber":30,"sourceCode":"    name: 'rfc',\n    access: 'read',\n    description: 'Single IETF RFC metadata (title, abstract, working group, authors, std level)',\n    domain: 'datatracker.ietf.org',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'number', positional: true, type: 'int', required: true, help: 'RFC number (e.g. 9000, 791, 2616)' },\n    ],\n    columns: [\n        'rfc', 'title', 'state', 'stdLevel', 'group', 'groupType',\n        'pages', 'published', 'authors', 'abstract', 'rfcEditorUrl', 'url',\n    ],\n    func: async (args) => {\n        const number = requireRfcNumber(args.number);\n        const name = `rfc${number}`;\n        const doc = await rfcFetch(`${RFC_BASE}/doc/${name}/doc.json`, `rfc ${number}`);\n        if (!doc || !doc.name) {\n            throw new EmptyResultError('rfc rfc', `IETF datatracker returned no metadata for RFC ${number}.`);\n        }\n        const authors = Array.isArray(doc.authors)\n            ? doc.authors.map((a) => String(a?.name ?? '').trim()).filter(Boolean).join(', ')\n            : '';\n        const groupName = String(doc.group?.name ?? '').trim();\n        const groupType = String(doc.group?.type ?? '').trim();\n        return [{\n            rfc: number,\n            title: String(doc.title ?? '').trim(),\n            state: String(doc.state ?? '').trim(),\n            stdLevel: String(doc.std_level ?? '').trim(),\n            group: groupName,\n            groupType,\n            pages: doc.pages == null ? null : Number(doc.pages),\n            published: trimDate(doc.time),\n            authors,\n            abstract: String(doc.abstract ?? '').trim(),\n            rfcEditorUrl: `https://www.rfc-editor.org/rfc/rfc${number}`,","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/rfc/rfc.js#L12-L48","documentation":"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.","triggerScenarios":"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.","commonSituations":"Querying RFC numbers that were never assigned or withdrawn before publication, or a datatracker schema change removing the name field from doc.json.","solutions":["Verify the RFC number exists (e.g. https://datatracker.ietf.org/doc/rfc9000/).","Check for typos in the RFC number.","Retry later if datatracker is having issues; the payload may be transiently incomplete.","Catch EmptyResultError and show a friendly 'no metadata found' message."],"exampleFix":"// before\nrfc rfc 9000000\n// after\nrfc rfc 9000","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  const doc = await fetchRfcMetadata(number);\n} catch (err) {\n  if (err instanceof EmptyResultError) {\n    console.error(`No metadata found for RFC ${number}: ${err.hint}`);\n  } else throw err;\n}","preventionTips":["Confirm RFC numbers exist in the datatracker index before batch lookups.","Handle EmptyResultError distinctly from network errors in tooling.","Watch for datatracker schema changes affecting doc.json fields.","Skip-and-log missing RFCs in bulk scripts instead of aborting."],"tags":["empty-result","api-response","ietf-datatracker"],"backgroundTag":"empty-result","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}