{"record":{"id":"e7fa58159d925d3a","repo":"DIYgod/RSSHub","slug":"type-not-supported-e7fa58","errorCode":null,"errorMessage":"type not supported","messagePattern":"type not supported","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/uestc/sise.ts","lineNumber":67,"sourceCode":"        {\n            source: ['sise.uestc.edu.cn/'],\n            target: '/sise',\n        },\n    ],\n    name: '信息与软件工程学院',\n    maintainers: ['Yadomin', 'mobyw'],\n    handler,\n    url: 'sise.uestc.edu.cn/',\n    description: `| 最新 | 院办 | 学生科 | 教务科 | 研管科 | 组织 | 人事 | 实践教育中心 | Int'I |\n| ---- | ---- | ------ | ------ | ------ | ---- | ---- | ------------ | ----- |\n| 1    | 2    | 3      | 4      | 5      | 6    | 7    | 8            | 9     |`,\n};\n\nasync function handler(ctx) {\n    const type = ctx.req.param('type') || 1;\n    const divId = mapId[type];\n    if (!divId) {\n        throw new InvalidParameterError('type not supported');\n    }\n\n    const context = await playwright();\n    const page = await context.newPage();\n    await page.route('**/*', (route) => {\n        const request = route.request();\n        request.resourceType() === 'document' || request.resourceType() === 'script' ? route.continue() : route.abort();\n    });\n    await page.goto(baseUrl, {\n        waitUntil: 'networkidle',\n    });\n    const content = await page.content();\n    await context.close();\n\n    const $ = load(content);\n\n    const items = $(`div[id=\"${divId}\"] p.news-item`);\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uestc/sise.ts#L49-L85","documentation":"InvalidParameterError thrown by the UESTC 信通 (sise) route when ctx.req.param('type') (defaulted to 1) does not map to a divId in mapId (keys 1–9). Because the default is numeric and the check uses mapId[type] truthiness, a non-numeric or out-of-range type (including a string that does not coerce to a key) is rejected before Playwright is launched.","triggerScenarios":"Requesting /uestc/sise/<type> with a value outside 1..9, or a non-numeric string. Default 1 (最新) is valid, so the error requires an explicit bad value.","commonSituations":"User passed a category name string instead of the numeric id; out-of-range number; stale URL using an old numbering scheme.","solutions":["Use an integer from 1 to 9 (see the description table for the section each maps to).","Omit :type to default to 1.","Update feed URLs that pass names instead of numbers."],"exampleFix":"// before\n// /uestc/sise/yuanban\n// after\n// /uestc/sise/2","handlingStrategy":"validation","validationCode":"const SISE_MAX = 9;\nfunction isValidSiseType(t: string | undefined): boolean {\n  if (t === undefined) return true;\n  const n = Number(t);\n  return Number.isInteger(n) && n >= 1 && n <= SISE_MAX;\n}","typeGuard":"function isSiseType(t: string): t is `${1|2|3|4|5|6|7|8|9}` {\n  const n = Number(t); return Number.isInteger(n) && n >= 1 && n <= 9;\n}","tryCatchPattern":null,"preventionTips":["Pass a numeric id (1–9), never the Chinese section name.","Default to 1 if unsure.","Document the numeric mapping alongside the feed builder."],"tags":["uestc","invalid-parameter","type-enum","numeric","playwright"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}