DIYgod/RSSHub · error · InvalidParameterError

id 为 ${catalogId} 的 List 不存在

Error message

id 为 ${catalogId} 的 List 不存在

What it means

InvalidParameterError thrown when the Medium catalog (list) API returns no usable data — the catalog object is null, or it lacks an itemsConnection. This means a list with the given catalogId does not exist or is empty for that user.

Source

Thrown at lib/routes/medium/list.ts:45

::: warning
To access private lists, only self-hosting is supported.
:::`,
};

async function handler(ctx) {
    const user = ctx.req.param('user');
    const catalogId = ctx.req.param('catalogId');

    const cookie = config.medium.cookies[user];

    const catalog = await getUserCatalogMainContentQuery(user, catalogId, cookie);
    ctx.set('json', catalog);

    if (catalog && catalog.__typename === 'Forbidden') {
        throw new ConfigNotFoundError(`无权访问 id 为 ${catalogId} 的 List(可能是未设置 Cookie 或 Cookie 已过期)`);
    }
    if (!catalog || !catalog.itemsConnection) {
        throw new InvalidParameterError(`id 为 ${catalogId} 的 List 不存在`);
    }

    const name = catalog.name;
    const urls = catalog.itemsConnection.items.map((item) => item.entity.mediumUrl);

    const parsedArticles = await Promise.all(urls.map((url) => parseArticle(ctx, url)));

    return {
        title: `List: ${name}`,
        link: `https://medium.com/@${user}/list/${catalogId}`,
        item: parsedArticles,
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Open the list on medium.com in a browser and copy the catalogId from the URL exactly.
  2. Confirm the :user segment matches the list owner.
  3. If the list was deleted, use the current list ID.
  4. Distinguish this from 367: if you get Forbidden, fix the cookie first.

Example fix

// before
// /medium/list/johndoe/abc123-wrong

// after
// /medium/list/johndoe/correct-uuid-from-url
Defensive patterns

Strategy: validation

Validate before calling

const catalogId = ctx.req.param('catalogId');
if (!catalogId || !/^[a-zA-Z0-9_-]+$/.test(catalogId)) {
    throw new InvalidParameterError('catalogId must be a non-empty alphanumeric token');
}

Type guard

function isCatalogId(value: unknown): value is string {
    return typeof value === 'string' && /^[a-zA-Z0-9_-]+$/.test(value);
}

Prevention

When it happens

Trigger: getUserCatalogMainContentQuery resolves to null, or to an object without itemsConnection (and __typename is not 'Forbidden'). Medium's API could not find a list matching the catalogId.

Common situations: Wrong catalogId in the URL; list was deleted by its owner; list ID copied incompletely; user segment refers to a different account that doesn't own the list.

Related errors


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