{"record":{"id":"b1b4e42db21b7f95","repo":"DIYgod/RSSHub","slug":"error","errorCode":null,"errorMessage":"参数不在可选范围之内","messagePattern":"参数不在可选范围之内","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/guat/news.js","lineNumber":38,"sourceCode":"    },\n    tzgg: {\n        url: `${host}/index/tzgg.htm`,\n        title: '通知公告',\n    },\n    xxgk: {\n        url: `${host}/index/xxgk.htm`,\n        title: '信息公开',\n    },\n    ghdjt: {\n        url: `${host}/index/ghdjt.htm`,\n        title: '桂航大讲堂',\n    },\n};\n\nmodule.exports = async (ctx) => {\n    const type = ctx.params.type || 'ghyw';\n    if (!urls[type]) {\n        throw new Error('参数不在可选范围之内');\n    }\n    const url = urls[type].url;\n    const title = urls[type].title;\n    const response = await got({\n        method: 'get',\n        url,\n    });\n    const data = response.data;\n    const $ = cheerio.load(data);\n\n    const list = [];\n    // 适应桂航的奇葩规则\n    for (let index = 0; index < 19; index++) {\n        const element = $(`#line_u8_${index}`);\n        const item_title = element.find('a').first().text();\n        const item_link = element.find('a').first().attr('href').replace('../', host);\n\n        list.push({","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/guat/news.js#L20-L56","documentation":"Thrown by the Guilin University of Aerospace Technology news route (deprecated) when the :type param (default 'ghyw') is not a key of the urls map (keys include ghyw, xxgk 信息公开, ghdjt 桂航大讲堂). The Chinese message means 'parameter is not within the selectable range'.","triggerScenarios":"Request with a :type segment absent from urls; the `if (!urls[type])` guard throws.","commonSituations":"Slug typo, using a type from a different university's route, or stale docs after the site renamed a column .htm file.","solutions":["Use a documented type slug (e.g. ghyw, xxgk, ghdjt).","Read the urls map at the top of lib/routes-deprecated/guat/news.js for accepted keys.","Note the default 'ghyw' applies when the param is omitted."],"exampleFix":"// before\nGET /guat/news/xxgkk   // typo\n// after\nGET /guat/news/xxgk     // 信息公开","handlingStrategy":"validation","validationCode":"const VALID = ['ghyw', 'xxgk', 'ghdjt' /* see urls in lib/routes-deprecated/guat/news.js */];\nconst type = ctx.params.type || 'ghyw';\nif (!VALID.includes(type)) throw new Error(`参数非法. Valid: ${VALID.join(', ')}`);","typeGuard":"const isType = (v: string): v is 'ghyw' | 'xxgk' | 'ghdjt' => ['ghyw', 'xxgk', 'ghdjt'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/参数不在可选范围之内/.test(e.message)) listTypes(); else throw e; }","preventionTips":["Default 'ghyw' applies when omitted — leverage that.","Don't confuse guat (航天) with guet (电子) slugs."],"tags":["rsshub","parameter-validation","deprecated-route","university","i18n"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}