{"record":{"id":"d179ada656f166ef","repo":"DIYgod/RSSHub","slug":"error-d179ad","errorCode":null,"errorMessage":"参数不在可选范围之内","messagePattern":"参数不在可选范围之内","errorType":"exception","errorClass":null,"httpStatus":503,"severity":"warning","filePath":"lib/routes-deprecated/guet/news.js","lineNumber":47,"sourceCode":"    },\n    tzgg: {\n        path: '/xwzx/tzgg.htm',\n        title: '通知公告',\n    },\n    zbgs: {\n        path: '/xwzx/zbgs.htm',\n        title: '招标公示',\n    },\n    xshd: {\n        path: '/xwzx/xshd.htm',\n        title: '学术活动',\n    },\n};\n\nmodule.exports = async (ctx) => {\n    const type = ctx.params.type || 'gdyw';\n    if (!infos[type]) {\n        throw new Error('参数不在可选范围之内');\n    }\n    const path = infos[type].path.slice(1);\n\n    const response = await got(path, {\n        prefixUrl: host,\n    });\n    const data = response.data;\n    const $ = cheerio.load(data);\n    const list = $('tr[id^=\"line\"]').find('a');\n\n    const item = await Promise.all(\n        list\n            .map(async (index, element) => {\n                const href = $(element).attr('href');\n                const path = href && href.replace(/\\.\\./, '');\n                const link = host + path;\n\n                const item = await ctx.cache.tryGet(link, async () => {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes-deprecated/guet/news.js#L29-L65","documentation":"Thrown by the Guilin University of Electronic Technology news route (deprecated) when :type (default 'gdyw') is not a key of the infos map (keys include zbgs 招标公示, xshd 学术活动). Same Chinese 'parameter out of range' message; throws before the got request.","triggerScenarios":"Request with a :type segment not in infos; `if (!infos[type])` throws.","commonSituations":"Slug typo, or confusing this university's slugs with guat (Guilin Aerospace) slugs which look similar. The path is built by stripping a leading '/', so even valid-looking strings won't resolve if not a key.","solutions":["Use a documented type slug (e.g. gdyw, zbgs, xshd).","Confirm keys against the infos map at the top of lib/routes-deprecated/guet/news.js.","Do not mix slugs between guet and guat routes."],"exampleFix":"// before\nGET /guet/news/zhaobiao   // not a key\n// after\nGET /guet/news/zbgs         // 招标公示","handlingStrategy":"validation","validationCode":"const VALID = ['gdyw', 'zbgs', 'xshd' /* see infos in lib/routes-deprecated/guet/news.js */];\nconst type = ctx.params.type || 'gdyw';\nif (!VALID.includes(type)) throw new Error(`参数非法. Valid: ${VALID.join(', ')}`);","typeGuard":"const isType = (v: string): v is 'gdyw' | 'zbgs' | 'xshd' => ['gdyw', 'zbgs', 'xshd'].includes(v);","tryCatchPattern":"try { await fetch(route); }\ncatch (e) { if (/参数不在可选范围之内/.test(e.message)) listTypes(); else throw e; }","preventionTips":["Default 'gdyw' applies when omitted.","Path strips a leading '/', so only registered keys resolve."],"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"}