{"record":{"id":"b9d1a42c8bde8b30","repo":"DIYgod/RSSHub","slug":"this-type-does-not-exist-please-refer-to-the-docu","errorCode":null,"errorMessage":"This type does not exist. Please refer to the documentation for the correct usage.","messagePattern":"This type does not exist\\. Please refer to the documentation for the correct usage\\.","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"error","filePath":"lib/routes/ahstu/index.ts","lineNumber":58,"sourceCode":"    name: '官网通知与新闻',\n    maintainers: ['JizzCruiy'],\n    handler,\n    description: `| 栏目     | type |\n| -------- | ---- |\n| 安科要闻 | akyw |\n| 通知公告 | tzgg |\n| 学术安科 | xsak |\n| 校园动态 | xydt |\n| 媒体聚焦 | mtak |\n| 人物风采 | rwfc |\n| 视觉校园 | sjxy |`,\n};\n\nasync function handler(ctx) {\n    const type = ctx.req.param('type') ?? 'akyw';\n\n    if (!Object.hasOwn(types, type)) {\n        throw new InvalidParameterError('This type does not exist. Please refer to the documentation for the correct usage.');\n    }\n\n    const listUrl = `${baseUrl}${types[type].url}`;\n    const listResponse = await ofetch(listUrl);\n    const $ = load(listResponse);\n\n    // rwfc is an image gallery layout without dates; other columns use a text list layout\n    const isGallery = types[type].gallery === true;\n    const listSelector = isGallery ? 'a.img-ul-tt' : 'a.rigthConBox-conList';\n\n    const list = $(listSelector)\n        .toArray()\n        .map((item): DataItem => {\n            const $item = $(item);\n            const result: DataItem = {\n                title: isGallery ? $item.text().trim() : $item.find('.conListWord').text().trim(),\n                link: new URL($item.attr('href')!, baseUrl).href,\n            };","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ahstu/index.ts#L40-L76","documentation":"The AHSTU (安徽科技学院) route maps seven column slugs (akyw, tzgg, xsak, xydt, mtak, rwfc, sjxy) to section URLs. Object.hasOwn(types, type) rejects anything else before the request.","triggerScenarios":"Calling /ahstu/:type with a slug outside {akyw, tzgg, xsak, xydt, mtak, rwfc, sjxy} — typo, Chinese label instead of slug, or a column the site retired.","commonSituations":"Passing the Chinese column name ('通知公告'); typo ('tak' for 'mtak'); upstream reorganised columns.","solutions":["Use one of the seven documented slugs: akyw, tzgg, xsak, xydt, mtak, rwfc, sjxy.","Omit the segment to default to 'akyw'."],"exampleFix":"// before\n/ahstu/通知公告\n// after\n/ahstu/tzgg","handlingStrategy":"validation","validationCode":"const AHSTU_TYPES = new Set(['akyw','tzgg','xsak','xydt','mtak','rwfc','sjxy']);\nfunction validAhstuType(t) {\n  return AHSTU_TYPES.has(t);\n}","typeGuard":"function isAhstuType(t): t is 'akyw'|'tzgg'|'xsak'|'xydt'|'mtak'|'rwfc'|'sjxy' {\n  return ['akyw','tzgg','xsak','xydt','mtak','rwfc','sjxy'].includes(t);\n}","tryCatchPattern":null,"preventionTips":["Pass the English slug, not the Chinese column label.","Omit the segment to default to 'akyw'.","Re-verify the slug list after upstream site redesigns."],"tags":["validation","parameter","enum","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}