DIYgod/RSSHub · error · Error
Unknown category: ${category}
Error message
Unknown category: ${category} What it means
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.
Source
Thrown at lib/routes/uw/gix/news.ts:54
const category = ctx.req.param('category');
let newsURL = gixBaseURL + '/news';
let feedTitle = 'UW GIX News - ';
let listSelector = 'body > div.site > div.site-content > div.content-area > main.site-main > ';
switch (category) {
case 'blog':
newsURL += '/blog/';
feedTitle += 'Blogs';
listSelector += 'div.blog-wrapper > section.blog-list > article';
break;
case 'inthenews':
newsURL += '/inthenews/';
feedTitle += 'In The News';
listSelector += 'div.news-wrapper > section.news-list > article';
break;
default:
throw new Error(`Unknown category: ${category}`);
}
const response = await got(newsURL);
const data = response.data;
const $ = load(data);
const list = $(listSelector)
.toArray()
.map((item): DataItem & { time: string } => {
const $item = $(item);
const content = $item.find('header').find('h2').find('a');
const time = $item.find('header').find('span.h4').text();
return {
// title: content.text(),
time,View on GitHub (pinned to bed535e087)
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.
Example fix
// before GET /uw/gix/news/press // after GET /uw/gix/news/inthenews
Defensive patterns
Strategy: validation
Validate before calling
const VALID_CATEGORIES = ['blog', 'inthenews'];
if (!VALID_CATEGORIES.includes(category)) {
throw new InvalidParameterError(`Unknown category: ${category}. Valid: ${VALID_CATEGORIES.join(', ')}`);
} Type guard
function isValidGixCategory(c: string): c is 'blog' | 'inthenews' {
return c === 'blog' || c === 'inthenews';
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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`).
Related errors
- invalid type
- invalid type
- No topic named ${topic}
- Invalid time range: ${finalSearchParams.time_range}
- Invalid category: ${finalSearchParams.category}
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/7f439ef049774aac.
Report an issue: GitHub.