{"record":{"id":"e89534373f0771a7","repo":"jackwener/OpenCLI","slug":"medium-tag-tag-rss-feed-has-no-items","errorCode":null,"errorMessage":"Medium tag \"${tag}\" RSS feed has no items.","messagePattern":"Medium tag \"(.+?)\" RSS feed has no items\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/medium/tag.js","lineNumber":123,"sourceCode":"                `medium tag request failed: ${err?.message ?? err}`,\n                'Check that medium.com is reachable from this network.',\n            );\n        }\n        if (resp.status === 404) {\n            throw new EmptyResultError('medium tag', `Medium tag \"${tag}\" does not exist.`);\n        }\n        if (!resp.ok) {\n            throw new CommandExecutionError(`medium tag returned HTTP ${resp.status}`);\n        }\n        const xml = await resp.text();\n        const items = [];\n        const re = /<item[^>]*>([\\s\\S]*?)<\\/item>/g;\n        let m;\n        while ((m = re.exec(xml)) !== null) {\n            items.push(m[1]);\n        }\n        if (!items.length) {\n            throw new EmptyResultError('medium tag', `Medium tag \"${tag}\" RSS feed has no items.`);\n        }\n        return items.slice(0, limit).map((block, i) => ({\n            rank: i + 1,\n            title: decodeHtml(extractTag(block, 'title')).trim(),\n            author: decodeHtml(extractTag(block, 'dc:creator')).trim(),\n            description: stripHtml(extractTag(block, 'description')),\n            categories: extractCategories(block).join(', '),\n            published: isoDateFromRfc822(decodeHtml(extractTag(block, 'pubDate')).trim()),\n            url: decodeHtml(extractTag(block, 'link')).trim(),\n        }));\n    },\n});\n","sourceCodeStart":105,"sourceCodeEnd":136,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/medium/tag.js#L105-L136","documentation":"After fetching and parsing the RSS XML, if no <item> elements are found the adapter throws EmptyResultError: the tag resolved but its feed currently contains zero articles. This guards downstream consumers against empty output instead of returning an empty list.","triggerScenarios":"Calling `medium tag <tag>` on a tag whose RSS feed exists but has no items — brand-new tags, abandoned tags, or feeds temporarily returning empty bodies (sometimes during Medium-side incidents or anti-bot interstitials that return 200 with stripped content).","commonSituations":"Querying very niche or newly created tags; Medium serving a consent/anti-bot page with 200 OK so the item regex matches nothing; a tag that existed at 404-check time but whose feed body changed format.","solutions":["Retry later — Medium may be serving an empty or altered feed temporarily.","Inspect the raw feed with curl https://medium.com/feed/tag/<slug> to confirm whether items are truly absent or the response is an anti-bot page.","Choose a more active related tag for your query.","If the feed visibly has items but the CLI reports none, report a parser bug (the <item> regex in clis/medium/tag.js) upstream."],"exampleFix":"// before\nmedium tag my-obscure-new-tag   # EmptyResultError: feed has no items\n// after\nmedium tag programming","handlingStrategy":"fallback","validationCode":"const res = await fetch(`https://medium.com/feed/tag/${slug}`);\nconst xml = await res.text();\nif (res.ok && !/<item[\\s>]/.test(xml)) console.warn(`Feed for \"${slug}\" currently has no items`);","typeGuard":null,"tryCatchPattern":"try {\n  items = await run(['medium', 'tag', slug]);\n} catch (e) {\n  if (e instanceof EmptyResultError && /has no items/.test(e.message)) {\n    items = []; // treat as legitimately empty, or fall back to a broader tag\n  } else throw e;\n}","preventionTips":["Treat empty feeds as an expected outcome for niche/new tags.","Fall back to related, more active tags when a feed is empty.","Retry later — Medium sometimes serves empty/altered bodies transiently.","Inspect the raw feed with curl before assuming the parser is broken."],"tags":["rss","empty-result","cli","parsing"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}