{"record":{"id":"dfed19994b81b963","repo":"DIYgod/RSSHub","slug":"type-not-supported-dfed19","errorCode":null,"errorMessage":"type not supported","messagePattern":"type not supported","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/uestc/gr.ts","lineNumber":63,"sourceCode":"    radar: [\n        {\n            source: ['gr.uestc.edu.cn/'],\n        },\n    ],\n    name: '研究生院',\n    maintainers: ['huyyi', 'mobyw'],\n    handler,\n    url: 'gr.uestc.edu.cn/',\n    description: `\\\n| 重要公告  | 教学管理 | 学位管理 | 学生管理 | 就业实践 |\n| --------- | -------- | -------- | -------- | -------- |\n| important | teaching | degree   | student  | practice |`,\n};\n\nasync function handler(ctx: Context): Promise<Data> {\n    const type = ctx.req.param('type') || 'important';\n    if (!Object.hasOwn(typeUrlMap, type)) {\n        throw new InvalidParameterError('type not supported');\n    }\n    const typeName = typeNameMap[type];\n\n    const indexContent = await ofetch(baseUrl + typeUrlMap[type]);\n\n    const $ = load(indexContent);\n    const entries = $('div.title').toArray();\n\n    const items = entries.map(async (entry) => {\n        const element = $(entry);\n        const newsTitle = element.find('a').text();\n        const newsLink = detailUrl + element.find('a').attr('href');\n\n        const newsDetail = await cache.tryGet(newsLink, async () => {\n            const newsContent = await ofetch(newsLink);\n            const content = load(newsContent);\n\n            const basicInfo = content('div.topic_detail_header').find('div.info').text();","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uestc/gr.ts#L45-L81","documentation":"InvalidParameterError thrown by the UESTC 研究生院 (gr) route when ctx.req.param('type') is not an own property of typeUrlMap. Supported types are important, teaching, degree, student, practice; Object.hasOwn() is used so inherited keys cannot bypass the check.","triggerScenarios":"Requesting /uestc/gr/<type> with a slug outside the five supported values. Default is 'important', so the error implies an explicit bad value was supplied.","commonSituations":"User inferred a slug from the Chinese category names but did not match the documented English key; renamed slug; stale bookmark.","solutions":["Use one of: important, teaching, degree, student, practice.","Omit :type to default to 'important'.","Update saved feed URLs to the current slugs."],"exampleFix":"// before\n// /uestc/gr/xuewei\n// after\n// /uestc/gr/degree","handlingStrategy":"type-guard","validationCode":"const GR_TYPES = new Set(['important', 'teaching', 'degree', 'student', 'practice']);\nfunction isValidGrType(t: string | undefined): boolean {\n  return t === undefined || GR_TYPES.has(t);\n}","typeGuard":"type GrType = 'important' | 'teaching' | 'degree' | 'student' | 'practice';\nfunction isGrType(t: string): t is GrType { return GR_TYPES.has(t); }","tryCatchPattern":null,"preventionTips":["Use the documented English slugs exactly.","Centralize the slug list so UI/feed builders cannot drift from the route.","Default to 'important' when unsure."],"tags":["uestc","invalid-parameter","type-enum"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}