{"record":{"id":"9d1cc1c7fdf3f11a","repo":"jackwener/OpenCLI","slug":"not-found-9d1cc1","errorCode":"NOT_FOUND","errorMessage":"Article \"${args.title}\" not found","messagePattern":"Article \"(.+?)\" not found","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/wikipedia/summary.js","lineNumber":21,"sourceCode":"import { formatSummaryRow, wikiFetch } from './utils.js';\ncli({\n    site: 'wikipedia',\n    name: 'summary',\n    access: 'read',\n    description: 'Get Wikipedia article summary',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'title', positional: true, required: true, help: 'Article title (e.g. \"Transformer (machine learning model)\")' },\n        { name: 'lang', default: 'en', help: 'Language code (e.g. en, zh, ja)' },\n    ],\n    columns: ['title', 'description', 'extract', 'url'],\n    func: async (args) => {\n        const lang = args.lang || 'en';\n        const title = encodeURIComponent(args.title.replace(/ /g, '_'));\n        const data = (await wikiFetch(lang, `/api/rest_v1/page/summary/${title}`));\n        if (!data?.title)\n            throw new CliError('NOT_FOUND', `Article \"${args.title}\" not found`, 'Try searching first: opencli wikipedia search <keyword>');\n        return [formatSummaryRow(data, lang)];\n    },\n});\n","sourceCodeStart":3,"sourceCodeEnd":25,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/wikipedia/summary.js#L3-L25","documentation":"CliError with code NOT_FOUND thrown by `opencli wikipedia summary` when the REST summary endpoint /api/rest_v1/page/summary/<title> returns a body without a title field, meaning no article with that exact title exists on that language edition. The hint points to the search subcommand.","triggerScenarios":"`opencli wikipedia summary <title> --lang <lang>` where the REST API answers with a non-summary body (missing/404) lacking data.title — misspelled titles, wrong language edition, or REST API error responses (the REST endpoint returns 200 with error JSON in some cases, or wikiFetch already caught real HTTP errors).","commonSituations":"Using a display title with disambiguation instead of the canonical one, article exists in another language only, recent renames/deletions, typos.","solutions":["Run `opencli wikipedia search <keyword>` first and use an exact result title","Check spelling and capitalization of the title","Verify the article exists on <lang>.wikipedia.org in a browser","Try another --lang edition"],"exampleFix":"// before\nopencli wikipedia summary \"Python (programming langage)\"\n// after\nopencli wikipedia search \"Python programming\"\nopencli wikipedia summary \"Python (programming language)\"","handlingStrategy":"fallback","validationCode":null,"typeGuard":"function isSummary(d) {\n  return !!d && typeof d === 'object' && typeof d.title === 'string' && d.title.length > 0;\n}","tryCatchPattern":"try {\n  const rows = await run('wikipedia summary', [title, '--lang', lang]);\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    const hits = await run('wikipedia search', [title, '--lang', lang]);\n    if (hits.length) return run('wikipedia summary', [hits[0].title, '--lang', lang]);\n    throw e;\n  }\n  throw e;\n}","preventionTips":["Resolve the canonical title via search first","Use the exact article title (disambiguator included)","Confirm the article exists on the target language edition"],"tags":["not-found","wikipedia","rest-api"],"backgroundTag":"not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}