{"record":{"id":"200447369b51ee50","repo":"DIYgod/RSSHub","slug":"bad-category-see-a-href-https-docs-rsshub-app-200447","errorCode":null,"errorMessage":"Bad category. See <a href=\"https://docs.rsshub.app/routes/government#wu-han-shi-ke-xue-ji-shu-ju\">docs</a>","messagePattern":"Bad category\\. See <a href=\"https://docs\\.rsshub\\.app/routes/government#wu-han-shi-ke-xue-ji-shu-ju\">docs</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/gov/wuhan/kjj.js","lineNumber":22,"sourceCode":"const { parseDate } = require('@/utils/parse-date');\n\nconst root_url = 'http://kjj.wuhan.gov.cn/';\n\nconst config = {\n    tzgg: {\n        link: '/wmfw/tzgg/tzgg_18371/',\n        title: '通知公告',\n    },\n    gsxx: {\n        link: '/wmfw/tzgg/gsxx/',\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#wu-han-shi-ke-xue-ji-shu-ju\">docs</a>');\n    }\n\n    const current_url = url.resolve(root_url, cfg.link);\n    const response = await got({\n        method: 'get',\n        url: current_url,\n    });\n\n    const $ = cheerio.load(response.data);\n    const list = $('div.list_news li')\n        .slice(0, 20)\n        .map((_, item) => {\n            item = $(item);\n            const a = item.find('a[href]');\n            const span = item.find('span');\n            return {\n                title: a.text(),\n                link: url.resolve(current_url, a.attr('href')),","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/gov/wuhan/kjj.js#L4-L40","documentation":"Thrown by the Wuhan Science and Technology Bureau route (deprecated) when :caty is absent from the config map (documented keys include tzgg 通知公告, gsxx 公示信息). config[ctx.params.caty] undefined → throw before fetch.","triggerScenarios":"Request with a slug not in config, e.g. /gov/wuhan/kjj/<unknown>.","commonSituations":"Slug typo, or source portal restructure removing a section so its config entry was deleted.","solutions":["Use a documented slug such as tzgg or gsxx.","Confirm keys against the config map at the top of lib/routes-deprecated/gov/wuhan/kjj.js.","If the source page 404s, report the route as broken."],"exampleFix":"// before\nGET /gov/wuhan/kjj/tongzhi   // not a key\n// after\nGET /gov/wuhan/kjj/tzgg        // 通知公告","handlingStrategy":"validation","validationCode":"const VALID = ['tzgg', 'gsxx' /* see config in lib/routes-deprecated/gov/wuhan/kjj.js */];\nif (!VALID.includes(ctx.params.caty)) throw new Error('Invalid caty');","typeGuard":"const isCaty = (v: string): v is 'tzgg' | 'gsxx' => ['tzgg', 'gsxx'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/Bad category/.test(e.message)) listSlugs(); else throw e; }","preventionTips":["Don't confuse kjj (科技局) slugs with other Wuhan routes.","Re-check the source page still resolves."],"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"}