{"record":{"id":"351f1247e0f7b4ed","repo":"jackwener/OpenCLI","slug":"paper-args-id-was-not-found-check-the-arxiv-id","errorCode":null,"errorMessage":"Paper ${args.id} was not found. Check the arXiv ID format, e.g. 1706.03762","messagePattern":"Paper (.+?) was not found\\. Check the arXiv ID format, e\\.g\\. 1706\\.03762","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/arxiv/paper.js","lineNumber":19,"sourceCode":"import { cli, Strategy } from '@jackwener/opencli/registry';\nimport { EmptyResultError } from '@jackwener/opencli/errors';\nimport { arxivFetch, parseEntries } from './utils.js';\ncli({\n    site: 'arxiv',\n    name: 'paper',\n    access: 'read',\n    description: 'Get arXiv paper details by ID',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'id', positional: true, required: true, help: 'arXiv paper ID (e.g. 1706.03762)' },\n    ],\n    columns: ['id', 'title', 'authors', 'published', 'updated', 'primary_category', 'categories', 'abstract', 'comment', 'pdf', 'url'],\n    func: async (args) => {\n        const xml = await arxivFetch(`id_list=${encodeURIComponent(args.id)}`);\n        const entries = parseEntries(xml);\n        if (!entries.length)\n            throw new EmptyResultError('arxiv paper', `Paper ${args.id} was not found. Check the arXiv ID format, e.g. 1706.03762`);\n        return entries;\n    },\n});\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/arxiv/paper.js#L1-L23","documentation":"An EmptyResultError thrown when fetching a paper by arXiv ID returns no entries. The command queries arXiv's id_list endpoint and, if the response parses to zero entries, concludes the ID does not correspond to any paper. Commonly caused by a malformed or nonexistent ID, since arXiv silently returns an empty feed for unknown id_list values rather than an HTTP error.","triggerScenarios":"`opencli arxiv paper <id>` where the id_list query yields no entries: wrong ID digits, missing version handling, old-style IDs with wrong prefix (math/9901001v1), or IDs containing characters that break the query.","commonSituations":"Typo'd IDs from citations or notes; passing a DOI or URL instead of an arXiv ID; papers withdrawn/removed from arXiv; confusion between the arXiv ID and the published journal ID.","solutions":["Verify the ID format: modern IDs look like 1706.03762 (optionally v2), old ones like cond-mat/0703470","Check the paper exists at https://arxiv.org/abs/<id> in a browser","Strip any URL prefix — pass only the bare ID, not the full arxiv.org/abs/ URL","Use `opencli arxiv search <title keywords>` to find the correct ID"],"exampleFix":"// before\nawait exec('opencli arxiv paper ' + userInput); // may be a URL or DOI\n// after\nconst m = String(userInput).match(/(\\d{4}\\.\\d{4,5})(v\\d+)?$/);\nif (!m) throw new Error('not an arXiv ID: ' + userInput);\nawait exec('opencli arxiv paper ' + m[1]);","handlingStrategy":"validation","validationCode":"const id = String(paperId || '').trim().replace(/^https?:\\/\\/arxiv\\.org\\/(abs|pdf)\\//, '');\nif (!/^(\\d{4}\\.\\d{4,5}|[a-z-]+\\/\\d{7})(v\\d+)?$/i.test(id)) {\n  throw new Error(`not a valid arXiv ID: ${paperId}`);\n}","typeGuard":"function isArxivId(s) { return typeof s === 'string' && /^(\\d{4}\\.\\d{4,5}|[a-z-]+\\/\\d{7})(v\\d+)?$/i.test(s.trim()); }","tryCatchPattern":"try {\n  return await exec('opencli arxiv paper ' + id);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    console.error('ID not found; verify at https://arxiv.org/abs/' + id);\n    return null;\n  }\n  throw e;\n}","preventionTips":["Strip URL prefixes before passing IDs","Use the new-style format (1706.03762) when possible","Verify unknown IDs on arxiv.org/abs before scripting around them","Use keyword search to recover the correct ID when a lookup fails"],"tags":["empty-result","arxiv","input"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}