{"record":{"id":"7f439ef049774aac","repo":"DIYgod/RSSHub","slug":"unknown-category-category-7f439e","errorCode":null,"errorMessage":"Unknown category: ${category}","messagePattern":"Unknown category: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/uw/gix/news.ts","lineNumber":54,"sourceCode":"    const category = ctx.req.param('category');\n\n    let newsURL = gixBaseURL + '/news';\n    let feedTitle = 'UW GIX News - ';\n    let listSelector = 'body > div.site > div.site-content > div.content-area > main.site-main > ';\n\n    switch (category) {\n        case 'blog':\n            newsURL += '/blog/';\n            feedTitle += 'Blogs';\n            listSelector += 'div.blog-wrapper > section.blog-list > article';\n            break;\n        case 'inthenews':\n            newsURL += '/inthenews/';\n            feedTitle += 'In The News';\n            listSelector += 'div.news-wrapper > section.news-list > article';\n            break;\n        default:\n            throw new Error(`Unknown category: ${category}`);\n    }\n\n    const response = await got(newsURL);\n\n    const data = response.data;\n\n    const $ = load(data);\n\n    const list = $(listSelector)\n        .toArray()\n        .map((item): DataItem & { time: string } => {\n            const $item = $(item);\n            const content = $item.find('header').find('h2').find('a');\n            const time = $item.find('header').find('span.h4').text();\n\n            return {\n                // title: content.text(),\n                time,","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/uw/gix/news.ts#L36-L72","documentation":"Thrown by the UW Global Innovation Exchange (GIX) news route when the `category` path parameter does not match `blog` or `inthenews`. Unlike other USTC/UW routes, the `category` parameter here is required (no default) — the path is `/gix/news/:category` with no `?`. This is a generic `Error`, not an RSSHub typed error.","triggerScenarios":"A request to `/uw/gix/news/:category` where `:category` is not `blog` or `inthenews`. Since the parameter is required (not optional), omitting it entirely results in a route-not-found rather than this error. Only a present-but-invalid value triggers this throw.","commonSituations":"Using a category name from a different news route, guessing a category like `events` or `press`, or a case mismatch (e.g. `Blog` instead of `blog`).","solutions":["Use exactly `blog` or `inthenews` as the category (case-sensitive, lowercase).","Check the route's description table for the valid category codes.","If you need a category that doesn't exist, the source site (gixnetwork.org) may not provide an RSS-compatible feed for it."],"exampleFix":"// before\nGET /uw/gix/news/press\n// after\nGET /uw/gix/news/inthenews","handlingStrategy":"validation","validationCode":"const VALID_CATEGORIES = ['blog', 'inthenews'];\nif (!VALID_CATEGORIES.includes(category)) {\n    throw new InvalidParameterError(`Unknown category: ${category}. Valid: ${VALID_CATEGORIES.join(', ')}`);\n}","typeGuard":"function isValidGixCategory(c: string): c is 'blog' | 'inthenews' {\n    return c === 'blog' || c === 'inthenews';\n}","tryCatchPattern":null,"preventionTips":["Use InvalidParameterError instead of generic Error for HTTP 400 semantics.","Make the category parameter optional with a default to avoid requiring the user to know valid values.","Include valid options in the error message."],"tags":["parameter-validation","switch-default","uw","rss-route","required-parameter"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}