DIYgod/RSSHub · warning · NotFoundError

The column ${columnParam} does not exist

Error message

The column ${columnParam} does not exist

What it means

Thrown as a `NotFoundError` (HTTP 404) when the `column` path parameter for the NWNU (Northwest Normal University) Computer Science college route is not a key in the `COLUMNS` object. The COLUMNS map defines supported column IDs (like those for '研究生招生' and '评估动态') with title and description metadata. The column value is used to build the list page URL `https://jsj.nwnu.edu.cn/${columnParam}/list.htm`.

Source

Thrown at lib/routes/nwnu/routes/college/csse.ts:40

    },
    '2437': {
        title: '学术动态',
        description: '计算机科学与工程 学术动态',
    },
    '2446': {
        title: '研究生招生',
        description: '计算机科学与工程学院 研究生招生动态及相关新闻',
    },
    '8411': {
        title: '评估动态',
        description: '计算机科学与工程学院 院系学科评估动态',
    },
};

const handler: Route['handler'] = async (ctx) => {
    const columnParam = ctx.req.param('column')!;
    if (COLUMNS[columnParam] === undefined) {
        throw new NotFoundError(`The column ${columnParam} does not exist`);
    }
    const columnTitle = COLUMNS[columnParam].title;
    const columnDescription = COLUMNS[columnParam].description;
    const columnPageUrl = `https://jsj.nwnu.edu.cn/${columnParam}/list.htm`;

    // Fetch the list page
    const { data: listResponse } = await got(columnPageUrl);
    const $ = load(listResponse);

    // Select all list items containing academic information
    const ITEM_SELECTOR = 'ul > li.clearfix';
    const listItems = $(ITEM_SELECTOR);

    // Map through each list item to extract details
    const itemLinks = listItems.toArray().map((element) => {
        const title = $(element).find('div.right_list_text > p.p1 > a').text()!;
        const imgRelativeLink = $(element).find('div.right_list_img > a > img').attr('src') || WEBSITE_LOGO;
        const img = new URL(imgRelativeLink, BASE_URL).href;

View on GitHub (pinned to bed535e087)

Solutions

  1. Use only the column IDs defined in the COLUMNS object in `lib/routes/nwnu/routes/college/csse.ts`.
  2. Browse `https://jsj.nwnu.edu.cn/` to find valid column IDs from the navigation.
  3. If the college added a new column, add it to the COLUMNS object.
Defensive patterns

Strategy: validation

Validate before calling

// Validate column against COLUMNS keys
const validColumns = new Set(Object.keys(COLUMNS));
if (!validColumns.has(columnParam)) {
    throw new NotFoundError(
        `The column ${columnParam} does not exist. Valid columns: ${[...validColumns].join(', ')}`
    );
}

Type guard

function isValidColumn(column: string, columns: Record<string, unknown>): column is string {
    return Object.hasOwn(columns, column);
}

Prevention

When it happens

Trigger: Requesting `/nwnu/...` with a column parameter that doesn't match any key in COLUMNS (e.g., a non-existent numeric column ID). The column value becomes a path segment in the scraped URL.

Common situations: User passes an arbitrary column number not in the COLUMNS map. The college website restructured its column numbering. A bookmarked or radar URL references an outdated column ID.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/b5f3a873c7b67ba4. Report an issue: GitHub.