{"record":{"id":"b25a06615ab41150","repo":"jackwener/OpenCLI","slug":"dblp-pid-pidarg-is-not-a-valid-pid","errorCode":null,"errorMessage":"dblp pid \"${pidArg}\" is not a valid PID","messagePattern":"dblp pid \"(.+?)\" is not a valid PID","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/dblp/author.js","lineNumber":78,"sourceCode":"    access: 'read',\n    description: 'List dblp publications by a given author (newest first; resolves to top PID match)',\n    domain: 'dblp.org',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'author', positional: true, required: false, help: 'Author name (e.g. \"Yoshua Bengio\"). Optional when --pid is given.' },\n        { name: 'pid', help: 'Canonical dblp PID (e.g. \"56/953\"). Bypasses author search.' },\n        { name: 'limit', type: 'int', default: 20, help: 'Max publications (1-200)' },\n    ],\n    columns: ['rank', 'key', 'title', 'authors', 'venue', 'year', 'type', 'doi', 'pid', 'url'],\n    func: async (args) => {\n        const limit = requireBoundedInt(args.limit, 20, 200);\n        const pidArg = args.pid != null ? String(args.pid).trim() : '';\n        let pid = '';\n        let resolvedName = '';\n        if (pidArg) {\n            if (!PID_PATTERN.test(pidArg)) {\n                throw new ArgumentError(\n                    `dblp pid \"${pidArg}\" is not a valid PID`,\n                    'Expected something like \"56/953\" — visit the author page on dblp.org to find it.',\n                );\n            }\n            pid = pidArg;\n        }\n        else {\n            const name = requireQuery(args.author, 'author');\n            const json = await dblpFetchJson(\n                `/search/author/api?q=${encodeURIComponent(name)}&format=json&h=20`,\n                'dblp author search',\n            );\n            const raw = json?.result?.hits?.hit;\n            const hits = Array.isArray(raw) ? raw : (raw ? [raw] : []);\n            if (!hits.length) {\n                throw new EmptyResultError(\n                    'dblp author',\n                    `No dblp author matched \"${name}\". Try a different spelling, or pass --pid to bypass author search.`,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dblp/author.js#L60-L96","documentation":"ArgumentError thrown before any network call when the --pid argument does not match dblp's PID pattern (e.g. '56/953'). dblp author IDs are of the form 'letters/digits', and the library validates the format up front to fail fast with a helpful hint.","triggerScenarios":"Calling `dblp author --pid <value>` where value lacks the 'xx/nnn' shape — e.g. a full dblp URL pasted whole, a name instead of a PID, whitespace-mangled input, or a truncated PID like '56'.","commonSituations":"Pasting 'https://dblp.org/pid/56/953.html' instead of just '56/953'; typo such as '56-953'; passing an ORCID or Google Scholar ID by mistake.","solutions":["Visit the author's page on dblp.org and copy the pid portion (e.g. '56/953') from the URL","Strip any URL prefix — pass only the 'xx/nnn' segment, not the full link","Omit --pid entirely and let the CLI resolve the author by name","Check for stray quotes/whitespace when copying the PID"],"exampleFix":"// before\nopencli dblp author --pid https://dblp.org/pid/56/953.html\n// Error: dblp pid \"https://dblp.org/pid/56/953.html\" is not a valid PID\n// after\nopencli dblp author --pid 56/953","handlingStrategy":"validation","validationCode":"const PID_PATTERN = /^[a-z]+\\/\\d+$/i;\nif (!pidArg || !PID_PATTERN.test(String(pidArg).trim())) {\n  throw new Error(`--pid must look like \"56/953\", got: ${pidArg}`);\n}","typeGuard":"function isValidDblpPid(v) {\n  return typeof v === 'string' && /^[a-z]+\\/\\d+$/.test(v.trim());\n}","tryCatchPattern":"try {\n  await dblpAuthor({ pid: pidArg });\n} catch (err) {\n  if (/is not a valid PID/.test(err.message)) {\n    console.error('Pass only the xx/nnn segment of the dblp URL, not the full URL.');\n  } else throw err;\n}","preventionTips":["Copy PIDs only from the dblp author URL path (dblp.org/pid/56/953 → '56/953')","Normalize input: strip URL prefixes and trim whitespace before passing --pid","Prefer name-based lookup and use --pid only when search fails","Add a regex check in scripts that construct --pid from data sources"],"tags":["dblp","argument-validation","cli"],"backgroundTag":"invalid-argument-format","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}