{"record":{"id":"1d71db0f443554be","repo":"jackwener/OpenCLI","slug":"dblp-paper-key-is-required","errorCode":null,"errorMessage":"dblp paper key is required","messagePattern":"dblp paper key is required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/dblp/utils.js","lineNumber":115,"sourceCode":"    }\n    if (n > maxValue) {\n        throw new ArgumentError(`dblp ${label} must be <= ${maxValue}`);\n    }\n    return n;\n}\n\nexport function requireQuery(value, label = 'query') {\n    const q = String(value ?? '').trim();\n    if (!q) {\n        throw new ArgumentError(`dblp ${label} cannot be empty`);\n    }\n    return q;\n}\n\nexport function requireRecordKey(value) {\n    const key = String(value ?? '').trim();\n    if (!key) {\n        throw new ArgumentError('dblp paper key is required');\n    }\n    if (!KEY_PATTERN.test(key)) {\n        throw new ArgumentError(`dblp paper key \"${value}\" is not a valid record key`, 'Expected something like \"conf/nips/VaswaniSPUJGKP17\" — copy the `key` column from `dblp search`.');\n    }\n    return key;\n}\n\n/** Decode the small set of XML entities dblp emits in record bodies. */\nexport function decodeXmlEntities(text) {\n    if (!text) return '';\n    return String(text)\n        .replace(/&amp;/g, '&')\n        .replace(/&lt;/g, '<')\n        .replace(/&gt;/g, '>')\n        .replace(/&apos;/g, \"'\")\n        .replace(/&quot;/g, '\"')\n        .replace(/&#x([0-9a-fA-F]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16)))\n        .replace(/&#(\\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10)));","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dblp/utils.js#L97-L133","documentation":"Thrown by requireRecordKey when the paper/record key argument is missing or empty. Fetching a specific dblp record requires its key (e.g. conf/nips/VaswaniSPUJGKP17).","triggerScenarios":"Running a dblp paper/record command with no key argument, an empty string, or a shell variable that expanded to nothing.","commonSituations":"Omitting the positional key; scripting with an unset variable; piping intended to supply the key that produced no input.","solutions":["Pass the record key as the argument, e.g. dblp paper conf/nips/VaswaniSPUJGKP17","Copy the key from the `key` column of a previous `dblp search`","Check that the shell variable or pipe supplying the key is non-empty"],"exampleFix":"// before\nnode cli.js dblp paper\n// after\nnode cli.js dblp paper conf/nips/VaswaniSPUJGKP17","handlingStrategy":"validation","validationCode":"const key = (process.argv[3] ?? '').trim();\nif (!key) {\n  console.error('Usage: dblp paper <record-key>  e.g. conf/nips/VaswaniSPUJGKP17');\n  process.exit(2);\n}","typeGuard":"function isNonEmptyString(v) { return typeof v === 'string' && v.trim().length > 0; }","tryCatchPattern":"try {\n  const row = await dblpPaper(rawKey);\n} catch (err) {\n  if (/paper key is required/.test(err.message)) {\n    console.error('Pass a record key from `dblp search` (key column)');\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Capture the key from `dblp search` output before running `dblp paper`","Check pipes/scripts that supply the key actually produce output","Default unset shell variables explicitly before use","Show usage text when the positional argument is missing"],"tags":["validation","arguments","cli","input"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}