{"record":{"id":"28d054218fd94863","repo":"DIYgod/RSSHub","slug":"invalid-type-28d054","errorCode":null,"errorMessage":"invalid type","messagePattern":"invalid type","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/ustc/eeis.ts","lineNumber":49,"sourceCode":"        {\n            source: ['eeis.ustc.edu.cn/'],\n            target: '/eeis',\n        },\n    ],\n    name: '电子工程与信息科学系',\n    maintainers: ['jasongzy'],\n    handler,\n    url: 'eeis.ustc.edu.cn/',\n    description: `| 通知公告 | 新闻信息 |\n| -------- | -------- |\n| tzgg     | xwxx     |`,\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\n    const response = await got(`${host}/${id}/list.htm`);\n    const $ = load(response.data);\n    const list = $('div[portletmode=simpleList]')\n        .find('article')\n        .toArray()\n        .map((item): DataItem => {\n            const $item = $(item);\n            const title = $item.find('h4 > a').eq(1).attr('title')!.trim();\n            let link = $item.find('h4 > a').attr('href');\n            link = link!.startsWith('/') ? host + link : link;\n            const pubDate = timezone(parseDate($item.find('.post-date > time').text().replace('发布时间：', ''), 'YYYY-MM-DD'), 8);\n            return {\n                title,\n                pubDate,\n                link,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ustc/eeis.ts#L31-L67","documentation":"InvalidParameterError('invalid type') thrown by the USTC 院系 (eeis) route when ctx.req.param('type') does not resolve to an entry in the map (a Map<string, {id,...}>). Supported types: tzgg (通知公告), xwxx (新闻信息); default 'tzgg'. The check uses map.get(type) truthiness.","triggerScenarios":"Requesting /ustc/eeis/<type> with a slug other than 'tzgg' or 'xwxx'.","commonSituations":"Slug typo; guessed slug; retired slug referenced by an old feed URL.","solutions":["Use 'tzgg' or 'xwxx'.","Omit :type to default to 'tzgg'.","Update stale feed URLs."],"exampleFix":"// before\n// /ustc/eeis/notice\n// after\n// /ustc/eeis/tzgg","handlingStrategy":"type-guard","validationCode":"const EEIS_TYPES = new Set(['tzgg', 'xwxx']);\nfunction isValidEeisType(t: string | undefined): boolean {\n  return t === undefined || EEIS_TYPES.has(t);\n}","typeGuard":"type EeisType = 'tzgg' | 'xwxx';\nfunction isEeisType(t: string): t is EeisType { return t === 'tzgg' || t === 'xwxx'; }","tryCatchPattern":null,"preventionTips":["Use 'tzgg' or 'xwxx' exactly.","Omit :type to default to 'tzgg'.","Cross-check against the route description table when building feed URLs."],"tags":["ustc","invalid-parameter","type-enum"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}