{"record":{"id":"66d69c6cba67c3c7","repo":"DIYgod/RSSHub","slug":"type-not-supported","errorCode":null,"errorMessage":"type not supported","messagePattern":"type not supported","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":null,"severity":"warning","filePath":"lib/routes/uestc/cqe.ts","lineNumber":52,"sourceCode":"        {\n            source: ['cqe.uestc.edu.cn/'],\n            target: '/cqe',\n        },\n    ],\n    name: '文化素质教育中心',\n    maintainers: ['truobel', 'mobyw'],\n    handler,\n    url: 'cqe.uestc.edu.cn/',\n    description: `| 活动预告 | 通知公告 |\n| -------- | -------- |\n| hdyg     | tzgg     |`,\n};\n\nasync function handler(ctx) {\n    const type = ctx.req.param('type') || 'tzgg';\n    const pageUrl = mapUrl[type];\n    if (!pageUrl) {\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 + pageUrl, {\n        waitUntil: 'networkidle',\n    });\n    const content = await page.content();\n    await context.close();\n\n    const $ = load(content);\n\n    const items = $('div.Newslist li');\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uestc/cqe.ts#L34-L70","documentation":"InvalidParameterError thrown by the UESTC 成电青年 (cqe) route when ctx.req.param('type') does not map to a key in mapUrl. The route supports only two categories (hdyg 活动预告, tzgg 通知公告); any other path segment for :type is rejected before launching the Playwright browser, saving a costly headless fetch.","triggerScenarios":"Requesting /uestc/cqe/<type> with a type other than 'hdyg' or 'tzgg'. Default is 'tzgg' so it also fires if mapUrl is edited to remove a key that a feed URL still references.","commonSituations":"User guessed a category slug; documentation link pointed at an old slug that was renamed; route description table was misread.","solutions":["Use only 'hdyg' or 'tzgg' as the :type path parameter (or omit it to default to 'tzgg').","Check the route description table in the source for the current valid slugs.","Update any saved feed URLs that reference retired slugs."],"exampleFix":"// before\n// /uestc/cqe/news\n// after\n// /uestc/cqe/tzgg   (or /uestc/cqe/hdyg)","handlingStrategy":"type-guard","validationCode":"const CQE_TYPES = new Set(['hdyg', 'tzgg']);\nfunction isValidCqeType(t: string | undefined): boolean {\n  return t === undefined || CQE_TYPES.has(t);\n}","typeGuard":"function isCqeType(type: string): type is 'hdyg' | 'tzgg' {\n  return type === 'hdyg' || type === 'tzgg';\n}","tryCatchPattern":null,"preventionTips":["Derive feed URLs from the route description table, not from the Chinese label.","When renaming slugs, keep aliases or publish a migration note.","Omit :type to use the documented default."],"tags":["uestc","invalid-parameter","type-enum","playwright"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}