{"record":{"id":"00c9cd26301d1707","repo":"DIYgod/RSSHub","slug":"bad-category-see-a-href-https-docs-rsshub-app-00c9cd","errorCode":null,"errorMessage":"Bad category. See <a href=\"https://docs.rsshub.app/routes/bbs#guang-gu-she-qu-zi-lun-tan\">docs</a>","messagePattern":"Bad category\\. See <a href=\"https://docs\\.rsshub\\.app/routes/bbs#guang-gu-she-qu-zi-lun-tan\">docs</a>","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/guanggoo/index.js","lineNumber":43,"sourceCode":"        link: '/node/finance',\n        title: '金融财经',\n    },\n    startup: {\n        link: '/node/startup',\n        title: '创业创客',\n    },\n    city: {\n        link: '/node/city',\n        title: '城市建设',\n    },\n};\n\nmodule.exports = async (ctx) => {\n    const category = ctx.params.category || 'index';\n\n    const cfg = config[category];\n    if (!cfg) {\n        throw new Error('Bad category. See <a href=\"https://docs.rsshub.app/routes/bbs#guang-gu-she-qu-zi-lun-tan\">docs</a>');\n    }\n\n    const currentUrl = url.resolve(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.topic-item h3 a')\n        .slice(0, 10)\n        .map((_, item) => {\n            item = $(item);\n            return {\n                title: item.text(),\n                link: url.resolve(rootUrl, item.attr('href').split('#')[0]),\n            };\n        })","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/guanggoo/index.js#L25-L61","documentation":"Thrown by the Guanggoo community forum route (deprecated) when the category (defaulting to 'index') is not a key of config (which includes index and city 城市建设 among others). config[category] undefined → throw before fetch.","triggerScenarios":"Request like /guanggoo/<unknown> where the segment is not a config key. Note the param defaults to 'index' so omitting it is safe.","commonSituations":"Typo in the node slug, or the forum renaming boards so old slugs were removed from config.","solutions":["Use a documented node slug (e.g. index, city).","Check the config map at the top of lib/routes-deprecated/guanggoo/index.js for the full key list.","Browse the live forum to find current node paths if config looks stale."],"exampleFix":"// before\nGET /guanggoo/citiy   // typo\n// after\nGET /guanggoo/city     // 城市建设","handlingStrategy":"validation","validationCode":"const VALID = ['index', 'city' /* + see config in lib/routes-deprecated/guanggoo/index.js */];\nconst category = ctx.params.category || 'index';\nif (!VALID.includes(category)) throw new Error(`Invalid category. Valid: ${VALID.join(', ')}`);","typeGuard":"const isCategory = (v: string): v is 'index' | 'city' => ['index', 'city'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/Bad category/.test(e.message)) listBoards(); else throw e; }","preventionTips":["Remember 'index' is the default — omit the param if unsure.","Boards rename on forums; refresh the allowlist periodically."],"tags":["rsshub","parameter-validation","deprecated-route","forum"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}