{"record":{"id":"6dd9b04543d34cc9","repo":"DIYgod/RSSHub","slug":"bad-category-see-a-href-https-docs-rsshub-app-6dd9b0","errorCode":null,"errorMessage":"Bad category. See <a href=\"https://docs.rsshub.app/routes/government#guang-dong-sheng-jiao-yu-ting\">docs</a>","messagePattern":"Bad category\\. See <a href=\"https://docs\\.rsshub\\.app/routes/government#guang-dong-sheng-jiao-yu-ting\">docs</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/gov/guangdong/edu.js","lineNumber":45,"sourceCode":"    },\n    jydt: {\n        link: '/zxzx/jydt/',\n        title: '教育动态',\n    },\n    tpxw: {\n        link: '/zxzx/tpxw/',\n        title: '图片新闻',\n    },\n    zscd: {\n        link: '/zxzx/tzgg/',\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#guang-dong-sheng-jiao-yu-ting\">docs</a>');\n    }\n\n    const currentUrl = url.resolve(rootUrl, cfg.link);\n    const response = await got({ method: 'get', url: currentUrl });\n\n    const $ = cheerio.load(response.data);\n    const list = $('div.list_list ul li')\n        .map((_, item) => {\n            item = $(item).find('a');\n            return {\n                title: item.text(),\n                link: item.attr('href'),\n            };\n        })\n        .get();\n\n    const items = await Promise.all(\n        list.map((item) =>","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/gov/guangdong/edu.js#L27-L63","documentation":"Thrown by the Guangdong Provincial Education Department route (deprecated) when :caty is not a config key. The handler reads config[ctx.params.caty]; on undefined it throws a plain Error linking to the docs anchor before any HTTP request.","triggerScenarios":"Request with a :caty not in the config map (documented slugs include tpxw 图片新闻 and zscd 政声传递). Miss throws immediately.","commonSituations":"Slug typo, stale docs, or the source portal renaming sections so a previously valid slug was removed from config.","solutions":["Use a documented slug such as tpxw or zscd.","Read the config map at the top of lib/routes-deprecated/gov/guangdong/edu.js for accepted keys.","Move to a maintained route if the deprecated one is broken."],"exampleFix":"// before\nGET /gov/guangdong/edu/tpuxw   // typo\n// after\nGET /gov/guangdong/edu/tpxw     // 图片新闻","handlingStrategy":"validation","validationCode":"const VALID = ['tpxw', 'zscd' /* see config in lib/routes-deprecated/gov/guangdong/edu.js */];\nif (!VALID.includes(ctx.params.caty)) throw new Error('Invalid caty');","typeGuard":"const isCaty = (v: string): v is 'tpxw' | 'zscd' => ['tpxw', 'zscd'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/Bad category/.test(e.message)) promptForSlug(); else throw e; }","preventionTips":["Do not reuse slugs from sibling Guangdong routes.","Validate slugs at the API boundary."],"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"}