{"record":{"id":"4a4d95bc729cb1b8","repo":"DIYgod/RSSHub","slug":"type-4a4d95","errorCode":null,"errorMessage":"暂不支持对${type}的订阅","messagePattern":"暂不支持对(.+?)的订阅","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":400,"severity":"warning","filePath":"lib/routes/nua/lib.ts","lineNumber":55,"sourceCode":"async function handler(ctx) {\n    const type = ctx.req.param('type');\n    let webPageName;\n\n    switch (type) {\n        case 'xwdt':\n            webPageName = '.wp_column.column-1.selected';\n            break;\n        case 'djdt':\n            webPageName = '.wp_column.column-2.selected';\n            break;\n        case 'zydt':\n            webPageName = '.wp_column.column-3.selected';\n            break;\n        case 'fwdt':\n            webPageName = '.wp_column.column-4.selected';\n            break;\n        default:\n            throw new InvalidParameterError(`暂不支持对${type}的订阅`);\n    }\n\n    const newsUrl = `${baseUrl}/${type}/list.htm`;\n    const listName = 'div.news_con';\n    const artiContent = '.wp_articlecontent';\n    const listDate = '.news_date';\n\n    const items = await util.ProcessList(newsUrl, baseUrl, listName, listDate, webPageName);\n    const results = await util.ProcessFeed(items[0], artiContent);\n\n    return {\n        title: 'NUA-图书馆-' + items[1],\n        link: `${baseUrl}/${type}/list.htm`,\n        description: '南京艺术学院 图书馆 ' + items[1],\n        item: results,\n    };\n}\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/nua/lib.ts#L37-L73","documentation":"Thrown as an `InvalidParameterError` when the `type` path parameter for the NUA Library route does not match any of the supported `case` branches. The switch assigns `webPageName` CSS selectors for specific library navigation categories (like djdt, zydt, fwdt), and the default branch throws.","triggerScenarios":"A user requests the NUA library route with a `type` value not among the predefined cases (which map to `.wp_column.column-N.selected` selectors). The type determines which news category page to scrape from the NUA library site.","commonSituations":"User passes an unsupported type value. The library website restructured its column layout. A bookmarked URL references an old type that was removed from the switch.","solutions":["Check the switch cases in `lib/routes/nua/lib.ts` for the complete list of supported type values (includes 'djdt', 'zydt', 'fwdt', and others above).","Browse the NUA library website to identify the correct type identifier.","Add a new `case` branch if the library added a new category."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate type against known switch cases\nconst validLibTypes = new Set(['xwgg', 'djdt', 'zydt', 'fwdt' /* ...all case labels */]);\nif (!validLibTypes.has(type)) {\n    throw new InvalidParameterError(`暂不支持对${type}的订阅`);\n}","typeGuard":"function isSupportedLibType(type: string): boolean {\n    return ['xwgg', 'djdt', 'zydt', 'fwdt'].includes(type);\n}","tryCatchPattern":null,"preventionTips":["Document all supported library type values in the route description.","Extract supported types into a constant array for validation.","Sync the switch cases with route documentation."],"tags":["validation","nua","invalid-parameter","chinese-site","scraper"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}