{"record":{"id":"11591eb628164c68","repo":"jackwener/OpenCLI","slug":"openreview-search-query-cannot-be-empty","errorCode":null,"errorMessage":"openreview search query cannot be empty","messagePattern":"openreview search query cannot be empty","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/openreview/search.js","lineNumber":24,"sourceCode":"import { noteToRow, openreviewFetch, requireBoundedInt } from './utils.js';\n\ncli({\n    site: 'openreview',\n    name: 'search',\n    access: 'read',\n    description: 'Search OpenReview papers by free-text query',\n    domain: 'openreview.net',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search keyword (e.g. \"diffusion model\")' },\n        { name: 'limit', type: 'int', default: 25, help: 'Max results (max 50)' },\n    ],\n    columns: ['rank', 'id', 'title', 'authors', 'venue', 'pdate', 'url'],\n    func: async (args) => {\n        const term = String(args.query ?? '').trim();\n        if (!term) {\n            throw new ArgumentError('openreview search query cannot be empty');\n        }\n        const limit = requireBoundedInt(args.limit, 25, 50);\n        const path = `/notes/search?term=${encodeURIComponent(term)}&type=terms&limit=${limit}`;\n        const json = await openreviewFetch(path, 'openreview search');\n        const notes = Array.isArray(json?.notes) ? json.notes : [];\n        if (!notes.length) {\n            throw new EmptyResultError('openreview', `No papers found for \"${term}\". Try a different keyword.`);\n        }\n        return notes.slice(0, limit).map((note, i) => {\n            const row = noteToRow(note);\n            return {\n                rank: i + 1,\n                id: row.id,\n                title: row.title,\n                authors: row.authors,\n                venue: row.venue,\n                pdate: row.pdate,\n                url: row.url,","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/openreview/search.js#L6-L42","documentation":"The openreview search command requires a non-empty query term. If args.query is missing, empty, or only whitespace, ArgumentError is thrown before any API request, because an empty term would produce a meaningless search request.","triggerScenarios":"args.query is undefined, '', or whitespace-only after String().trim() when invoking the search command.","commonSituations":"Forgetting the --query flag entirely; passing --query \"\" from a script variable that was empty; shells stripping quotes leaving an empty argument; CI pipelines with unset environment variables interpolated into the flag.","solutions":["Provide a non-empty search term, e.g. openreview search \"transformer attention\"","Quote the query in the shell to preserve spaces","Check the script/CI variable feeding --query is set and non-empty","Trim stray whitespace-only values before passing"],"exampleFix":"// before\nopenreview search --query \"\"\n// after\nopenreview search --query \"vision transformer\"","handlingStrategy":"validation","validationCode":"const term = String(rawQuery ?? '').trim();\nif (!term) {\n    throw new Error('Search query must be a non-empty string');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always quote --query values in the shell","Check upstream variables are set before interpolating into the flag","Trim inputs in wrapper scripts","Add a fail-fast check in CI before invoking the command"],"tags":["argument-validation","cli","input-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}