{"record":{"id":"4d176821a19b4493","repo":"DIYgod/RSSHub","slug":"unknown-category-category","errorCode":null,"errorMessage":"Unknown category: ${category}","messagePattern":"Unknown category: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"lib/routes/ustc/job.ts","lineNumber":60,"sourceCode":"    const category = ctx.req.param('category') ?? 'joblist2';\n\n    const rand = 0.01234567890123456;\n    const apiRootUrl = 'http://ustc.ahbys.com';\n    const rootUrl = 'http://www.job.ustc.edu.cn';\n\n    const currentUrl = `${rootUrl}/${category}.html`;\n\n    const response = await got({\n        method: (() => {\n            switch (category) {\n                case 'RecruitList':\n                case 'Broadcast':\n                case 'joblist2':\n                    return 'get';\n                case 'Doublechoice':\n                    return 'post';\n                default:\n                    throw new Error(`Unknown category: ${category}`);\n            }\n        })(),\n\n        url: (() => {\n            switch (category) {\n                case 'RecruitList':\n                    return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}&pagesize=20&pageindex=1&action=bookinglist&kind=13&keyword=`;\n                case 'Doublechoice':\n                    return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}`;\n                case 'Broadcast':\n                    return `${apiRootUrl}/API/Web/index10358.ashx?rd=${rand}&pagesize=20&pageindex=1&action=bookinglist2&kind=2`;\n                case 'joblist2':\n                    return `${apiRootUrl}/API/Web/index10358.ashx?action=joblist2&pagesize=50&pageindex=1&rand=${rand}&keyword=`;\n                default:\n                    throw new Error(`Unknown category: ${category}`);\n            }\n        })(),\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/ustc/job.ts#L42-L78","documentation":"Generic Error('Unknown category: <category>') thrown by the USTC 就业信息网 (job) route inside the method IIFE when the category switch falls through to default. Supported categories: RecruitList, Doublechoice, Broadcast, joblist2; default 'joblist2'. The throw happens during construction of the got() options, before any HTTP request.","triggerScenarios":"Requesting /ustc/job/<category> with a value outside the four supported categories. The same default branch is replicated in the url IIFE (598) and the form IIFE (599); whichever IIFE evaluates first surfaces, but the cause is identical.","commonSituations":"Category slug typo; mixed-case (e.g. 'recruitlist' vs 'RecruitList'); outdated feed URL; user guessed from the Chinese label instead of the English key.","solutions":["Use exactly one of: RecruitList, Doublechoice, Broadcast, joblist2 (case-sensitive).","Omit :category to default to 'joblist2'.","Update saved feed URLs to the current keys."],"exampleFix":"// before\n// /ustc/job/recruitlist\n// after\n// /ustc/job/RecruitList","handlingStrategy":"type-guard","validationCode":"const JOB_CATEGORIES = new Set(['RecruitList', 'Doublechoice', 'Broadcast', 'joblist2']);\nfunction isValidJobCategory(c: string | undefined): boolean {\n  return c === undefined || JOB_CATEGORIES.has(c);\n}","typeGuard":"type JobCategory = 'RecruitList' | 'Doublechoice' | 'Broadcast' | 'joblist2';\nfunction isJobCategory(c: string): c is JobCategory { return JOB_CATEGORIES.has(c); }","tryCatchPattern":null,"preventionTips":["Category keys are case-sensitive — match the exact capitalization.","Omit :category to default to 'joblist2'.","Build feed URLs from the description table, not the Chinese labels."],"tags":["ustc","invalid-parameter","type-enum","case-sensitive"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}