{"record":{"id":"5a12bc16f045fa01","repo":"DIYgod/RSSHub","slug":"invalid-type-5a12bc","errorCode":null,"errorMessage":"invalid type","messagePattern":"invalid type","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/njust/eoe.ts","lineNumber":42,"sourceCode":"        requirePuppeteer: true,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: '电光学院',\n    maintainers: ['jasongzy'],\n    handler,\n    description: `| 通知公告 | 新闻动态 |\n| -------- | -------- |\n| tzgg     | xwdt     |`,\n};\n\nasync function handler(ctx) {\n    const type = ctx.req.param('type') ?? 'tzgg';\n    const info = map.get(type);\n    if (!info) {\n        throw new InvalidParameterError('invalid type');\n    }\n    const id = info.id;\n    const siteUrl = host + id + '/list.htm';\n\n    const html = await getContent(siteUrl, true);\n    const $ = load(html);\n    const list = $('ul.news_ul').find('li');\n\n    return {\n        title: info.title,\n        link: siteUrl,\n        item: list.toArray().map((item) => ({\n            title: $(item).find('a').attr('title')!.trim(),\n            pubDate: timezone(parseDate($(item).find('span').text(), 'YYYY-MM-DD'), 8),\n            link: $(item).find('a').attr('href'),\n        })),\n    };\n}","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/njust/eoe.ts#L24-L60","documentation":"InvalidParameterError from the NJUST 电光学院 (EOE) route. Same Map-lookup pattern. Valid type keys are tzgg / xwdt.","triggerScenarios":"Calling /njust/eoe/:type with a value not in the EOE map — typo or code from a sibling route.","commonSituations":"User assumes 'xyxw' (valid on CS) works here — it does not; typo; cross-route code confusion.","solutions":["Use tzgg (通知公告) or xwdt (新闻动态) for this route.","Verify against the route description table.","Each njust/* route defines its own valid codes."],"exampleFix":"// before\nconst info = map.get(type);\nif (!info) {\n    throw new InvalidParameterError('invalid type');\n}\n\n// after — caller: GET /njust/eoe/tzgg or /njust/eoe/xwdt","handlingStrategy":"validation","validationCode":"const VALID = new Set(['tzgg','xwdt']);\nfunction buildNjustEoeUrl(type) {\n  if (!VALID.has(type)) throw new Error(`invalid type '${type}'. Valid: ${[...VALID].join(', ')}`);\n  return host + MAP[type] + '/list.htm';\n}","typeGuard":"const isEoeType = (t: string): t is 'tzgg'|'xwdt' => VALID.has(t);","tryCatchPattern":null,"preventionTips":["Only tzgg / xwdt are valid for EOE.","Do not copy codes from CS/CWC routes.","Validate client-side before requesting."],"tags":["validation","route-parameter","user-input","njust"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}