{"record":{"id":"dc5a051c64a687d5","repo":"DIYgod/RSSHub","slug":"bad-category-see-a-href-https-docs-rsshub-app-dc5a05","errorCode":null,"errorMessage":"Bad category. See <a href=\"https://docs.rsshub.app/routes/government#zhong-guo-zheng-fu-tu-jie\">docs</a>","messagePattern":"Bad category\\. See <a href=\"https://docs\\.rsshub\\.app/routes/government#zhong-guo-zheng-fu-tu-jie\">docs</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/gov/xinwen/tujie.js","lineNumber":30,"sourceCode":"    },\n    qtmh: {\n        link: '/manhua/qita.htm',\n        title: '其他漫画',\n    },\n    zhengce: {\n        link: '/tujie/zhengce.htm',\n        title: '图解政策',\n    },\n    qttj: {\n        link: '/tujie/qita.htm',\n        title: '其他图解',\n    },\n};\n\nmodule.exports = async (ctx) => {\n    const cfg = config[ctx.params.caty];\n    if (!cfg) {\n        throw new Error('Bad category. See <a href=\"https://docs.rsshub.app/routes/government#zhong-guo-zheng-fu-tu-jie\">docs</a>');\n    }\n\n    const rootUrl = 'http://www.gov.cn/xinwen';\n    const currentUrl = rootUrl + cfg.link;\n    const response = await got({\n        method: 'get',\n        url: currentUrl,\n    });\n\n    const $ = cheerio.load(response.data);\n    const list = $('div.Video_pane div.tplgd')\n        .slice(0, 15)\n        .map((_, item) => {\n            item = $(item);\n            const a = item.find('a').eq(1);\n            return {\n                title: a.text(),\n                link: `http://www.gov.cn${a.attr('href')}`,","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/gov/xinwen/tujie.js#L12-L48","documentation":"Thrown by the China.gov 图解 (illustrated policy) route (deprecated) when :caty is not a config key (documented: zhengce 图解政策, qttj 其他图解). The URL is built as rootUrl + cfg.link, so a miss throws first.","triggerScenarios":"Request with a slug outside the config map, e.g. /gov/xinwen/tujie/<unknown>.","commonSituations":"Slug typo, or the source site (www.gov.cn/xinwen) reorganizing the tujie section so a slug was dropped.","solutions":["Use zhengce (图解政策) or qttj (其他图解).","Verify against the config map at the top of lib/routes-deprecated/gov/xinwen/tujie.js.","If the underlying .htm page 404s, report the route."],"exampleFix":"// before\nGET /gov/xinwen/tujie/zhengcee   // typo\n// after\nGET /gov/xinwen/tujie/zhengce     // 图解政策","handlingStrategy":"validation","validationCode":"const VALID = ['zhengce', 'qttj' /* see config in lib/routes-deprecated/gov/xinwen/tujie.js */];\nif (!VALID.includes(ctx.params.caty)) throw new Error('Invalid caty');","typeGuard":"const isCaty = (v: string): v is 'zhengce' | 'qttj' => ['zhengce', 'qttj'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/Bad category/.test(e.message)) listSlugs(); else throw e; }","preventionTips":["Confirm the .htm endpoints on www.gov.cn still exist.","Validate before constructing the gov.cn URL."],"tags":["rsshub","parameter-validation","deprecated-route","government"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}