{"record":{"id":"03998c3dcbef75e5","repo":"DIYgod/RSSHub","slug":"bad-category-see-a-href-https-docs-rsshub-app-03998c","errorCode":null,"errorMessage":"Bad category. See <a href=\"https://docs.rsshub.app/routes/government#wu-han-dong-hu-xin-ji-shu-kai-fa-qu\">docs</a>","messagePattern":"Bad category\\. See <a href=\"https://docs\\.rsshub\\.app/routes/government#wu-han-dong-hu-xin-ji-shu-kai-fa-qu\">docs</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/gov/wuhan/wehdz.js","lineNumber":22,"sourceCode":"const { parseDate } = require('@/utils/parse-date');\n\nconst root_url = 'http://www.wehdz.gov.cn/';\n\nconst config = {\n    tz: {\n        link: '/tzgg_53/tz/',\n        title: '通知',\n    },\n    gg: {\n        link: '/tzgg_53/gg/',\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-dong-hu-xin-ji-shu-kai-fa-qu\">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 = $('ul.main-list li[class!=line]')\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/wehdz.js#L4-L40","documentation":"Thrown by the Wuhan East Lake High-Tech Zone (光谷) route (deprecated) when :caty is not in config (documented keys: tz 通知, gg 公告). Miss throws before the HTTP request.","triggerScenarios":"Request with a slug outside {tz, gg}, e.g. /gov/wuhan/wehdz/<unknown>.","commonSituations":"Slug typo or confusing this zone's slugs with the broader Wuhan kjj route slugs.","solutions":["Use tz (通知) or gg (公告).","Confirm against the config map at the top of lib/routes-deprecated/gov/wuhan/wehdz.js.","Do not reuse slugs from sibling Wuhan routes."],"exampleFix":"// before\nGET /gov/wuhan/wehdz/gonggao   // not a key\n// after\nGET /gov/wuhan/wehdz/gg          // 公告","handlingStrategy":"validation","validationCode":"const VALID = ['tz', 'gg'];\nif (!VALID.includes(ctx.params.caty)) throw new Error(`Invalid caty. Valid: ${VALID.join(', ')}`);","typeGuard":"const isCaty = (v: string): v is 'tz' | 'gg' => ['tz', 'gg'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/Bad category/.test(e.message)) showTzGg(); else throw e; }","preventionTips":["Only two valid slugs here — hardcode the allowlist.","Avoid reusing slugs from wuhan/kjj."],"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"}