{"record":{"id":"a5caca19d4f0d6fe","repo":"DIYgod/RSSHub","slug":"type-not-supported-a5caca","errorCode":null,"errorMessage":"type not supported","messagePattern":"type not supported","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/uestc/news.ts","lineNumber":50,"sourceCode":"        {\n            source: ['news.uestc.edu.cn/'],\n            target: '/news',\n        },\n    ],\n    name: '新闻中心',\n    maintainers: ['achjqz', 'mobyw'],\n    handler,\n    url: 'news.uestc.edu.cn/',\n    description: `| 学术    | 文化    | 公告         | 校内通知     |\n| ------- | ------- | ------------ | ------------ |\n| academy | culture | announcement | notification |`,\n};\n\nasync function handler(ctx) {\n    const type = ctx.req.param('type') || 'announcement';\n    const pageUrl = map[type];\n    if (!pageUrl) {\n        throw new InvalidParameterError('type not supported');\n    }\n\n    const response = await got.get(baseUrl + pageUrl);\n\n    const $ = load(response.data);\n\n    const items = $('div.notice-item.clearfix');\n\n    const out = $(items)\n        .toArray()\n        .map((item) => {\n            const $item = $(item);\n            const newsTitle = $item.find('a').text().trim();\n            const newsLink = baseUrl + $item.find('a').attr('href');\n            const newsDate = parseDate($item.find('div.date-box-sm').text().replace(dateRegex, '$1-$2-$3'));\n            const newsDescription = $item.find('div.content').text().trim().replace('&nbsp;', '');\n\n            return {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uestc/news.ts#L32-L68","documentation":"InvalidParameterError thrown by the UESTC 新闻中心 (news) route when ctx.req.param('type') does not resolve to a key in the map object (academy, culture, announcement, notification). Truthiness of map[type] is checked, so an undefined key triggers the error; default is 'announcement'.","triggerScenarios":"Requesting /uestc/news/<type> with a slug other than the four supported values.","commonSituations":"Slug typo; outdated feed URL referencing a retired slug; user misread the two-column description table.","solutions":["Use one of: academy, culture, announcement, notification.","Omit :type to default to 'announcement'.","Refresh saved feed URLs against the current route docs."],"exampleFix":"// before\n// /uestc/news/academic\n// after\n// /uestc/news/academy","handlingStrategy":"type-guard","validationCode":"const NEWS_TYPES = new Set(['academy', 'culture', 'announcement', 'notification']);\nfunction isValidNewsType(t: string | undefined): boolean {\n  return t === undefined || NEWS_TYPES.has(t);\n}","typeGuard":"type NewsType = 'academy' | 'culture' | 'announcement' | 'notification';\nfunction isNewsType(t: string): t is NewsType { return NEWS_TYPES.has(t); }","tryCatchPattern":null,"preventionTips":["Read the route description table for the exact slug.","Beware near-misses like 'academic' vs 'academy'.","Omit :type to default to 'announcement'."],"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"}