{"record":{"id":"19f7b5cd962fdfa4","repo":"DIYgod/RSSHub","slug":"type-not-supported-19f7b5","errorCode":null,"errorMessage":"type not supported","messagePattern":"type not supported","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/uestc/jwc.ts","lineNumber":64,"sourceCode":"        {\n            source: ['www.jwc.uestc.edu.cn/'],\n            target: '/jwc',\n        },\n    ],\n    name: '教务处',\n    maintainers: ['achjqz', 'mobyw'],\n    handler,\n    url: 'www.jwc.uestc.edu.cn/',\n    description: `\\\n| 重要公告  | 学生事务公告 | 教师事务公告 | 教学新闻 | 办公室 |\n| --------- | ------------ | ------------ | -------- | ------ |\n| important | student      | teacher      | teaching | office |`,\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.textAreo.clearfix').toArray();\n\n    const items = entries.map(async (entry) => {\n        const element = $(entry);\n        const newsTitle = element.find('a').attr('title') ?? '';\n        const newsLink = detailUrl + element.find('a').attr('newsid');\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.detail_header').find('div.item').text();","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uestc/jwc.ts#L46-L82","documentation":"InvalidParameterError thrown by the UESTC 教务处 (jwc) route when ctx.req.param('type') is not an own property of typeUrlMap. Supported types: important, student, teacher, teaching, office. Same Object.hasOwn() guard pattern as the gr route.","triggerScenarios":"Requesting /uestc/jwc/<type> with an unsupported slug; default is 'important'.","commonSituations":"Slug typo; renamed category; user guessed a Chinese-to-English mapping that does not match the implementation.","solutions":["Use one of: important, student, teacher, teaching, office.","Omit :type to default to 'important'.","Update stale feed URLs."],"exampleFix":"// before\n// /uestc/jwc/news\n// after\n// /uestc/jwc/important","handlingStrategy":"type-guard","validationCode":"const JWC_TYPES = new Set(['important', 'student', 'teacher', 'teaching', 'office']);\nfunction isValidJwcType(t: string | undefined): boolean {\n  return t === undefined || JWC_TYPES.has(t);\n}","typeGuard":"type JwcType = 'important' | 'student' | 'teacher' | 'teaching' | 'office';\nfunction isJwcType(t: string): t is JwcType { return JWC_TYPES.has(t); }","tryCatchPattern":null,"preventionTips":["Use the documented English slugs exactly.","Validate before constructing the feed URL.","Omit :type for the default 'important' category."],"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"}