{"record":{"id":"7c260a17410f917b","repo":"DIYgod/RSSHub","slug":"the-column-columnparam-does-not-exist-7c260a","errorCode":null,"errorMessage":"The column ${columnParam} does not exist","messagePattern":"The column (.+?) does not exist","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"warning","filePath":"lib/routes/nwnu/routes/department/academic-affairs.ts","lineNumber":28,"sourceCode":"\nconst WEBSITE_LOGO = 'https://www.nwnu.edu.cn/_upload/tpl/02/d9/729/template729/favicon.ico';\nconst BASE_URL = 'https://jwc.nwnu.edu.cn/';\n\nconst COLUMNS: Record<string, { title: string; description: string }> = {\n    tzgg: {\n        title: '通知公告',\n        description: '西北师范大学教务处通知公告',\n    },\n    jwkx: {\n        title: '教务快讯',\n        description: '西北师范大学教务快讯',\n    },\n};\n\nconst handler: Route['handler'] = async (ctx) => {\n    const columnParam = ctx.req.param('column')!;\n    if (COLUMNS[columnParam] === undefined) {\n        throw new NotFoundError(`The column ${columnParam} does not exist`);\n    }\n    const columnTitle = COLUMNS[columnParam].title;\n    const columnDescription = COLUMNS[columnParam].description;\n    const columnPageUrl = `https://jwc.nwnu.edu.cn/${columnParam}/list.htm`;\n\n    // Fetch the list page\n    const { data: listResponse } = await got(columnPageUrl);\n    const $ = load(listResponse);\n\n    // Select all list items containing academic information\n    const ITEM_SELECTOR = 'div.list_index > ul > li';\n    const listItems = $(ITEM_SELECTOR);\n\n    // Map through each list item to extract details\n    const itemLinks = listItems.toArray().map((element) => {\n        const title = $(element).find('span.f > a').text()!;\n        const date = parseDate($(element).find('span.r').text()!);\n        const relativeLink = $(element).find('span.f > a').attr('href')!;","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/nwnu/routes/department/academic-affairs.ts#L10-L46","documentation":"Thrown as a `NotFoundError` (HTTP 404) when the `column` path parameter for the NWNU Academic Affairs Office route is not a key in the `COLUMNS` object. The supported columns include string keys like 'tzgg' (通知公告) and 'jwkx' (教务快讯). The column value is used to build `https://jwc.nwnu.edu.cn/${columnParam}/list.htm`.","triggerScenarios":"Requesting the NWNU academic-affairs route with a column value that doesn't match any key in COLUMNS (e.g., a column name not among the predefined set like 'tzgg', 'jwkx').","commonSituations":"User passes an unsupported column identifier. The academic affairs website restructured its URL paths. A typo in the column name.","solutions":["Use only the column keys defined in COLUMNS in `lib/routes/nwnu/routes/department/academic-affairs.ts` (e.g., 'tzgg', 'jwkx').","Browse `https://jwc.nwnu.edu.cn/` to find valid column path segments.","Add new column entries to COLUMNS if the department added sections."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate column against COLUMNS keys\nconst validColumns = new Set(Object.keys(COLUMNS));\nif (!validColumns.has(columnParam)) {\n    throw new NotFoundError(\n        `The column ${columnParam} does not exist. Valid columns: ${[...validColumns].join(', ')}`\n    );\n}","typeGuard":"function isValidColumn(column: string, columns: Record<string, unknown>): column is string {\n    return Object.hasOwn(columns, column);\n}","tryCatchPattern":null,"preventionTips":["Use only column keys from the COLUMNS object (e.g., 'tzgg', 'jwkx').","Verify column paths by browsing jwc.nwnu.edu.cn.","Update COLUMNS when the academic affairs site changes."],"tags":["validation","nwnu","not-found","chinese-site","university"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}