DIYgod/RSSHub · warning · InvalidParameterError

暂不支持对${type}的订阅

Error message

暂不支持对${type}的订阅

What it means

InvalidParameterError thrown by the bangumi.tv subject index route's switch on the :type parameter. Implemented cases are episodes, comments, blogs, topics; any other type falls into default and is rejected with a Chinese message ('subscription for {type} is not yet supported').

Source

Thrown at lib/routes/bangumi.tv/subject/index.ts:55

    const id = ctx.req.param('id');
    const type = ctx.req.param('type') || 'ep';
    const showOriginalName = queryToBoolean(ctx.req.param('showOriginalName'));
    let response;
    switch (type) {
        case 'ep':
            response = await getEps(id, showOriginalName);
            break;
        case 'comments':
            response = await getComments(id, Number(ctx.req.query('minLength')) || 0);
            break;
        case 'blogs':
            response = await getFromAPI('blog')(id, showOriginalName);
            break;
        case 'topics':
            response = await getFromAPI('topic')(id, showOriginalName);
            break;
        default:
            throw new InvalidParameterError(`暂不支持对${type}的订阅`);
    }
    return response;
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Use one of the implemented types: episodes, comments, blogs, topics.
  2. To add support, implement the fetcher and add a case branch before default.

Example fix

// before
default:
    throw new InvalidParameterError(`暂不支持对${type}的订阅`);

// after: list supported types in the message
const SUPPORTED = ['episodes', 'comments', 'blogs', 'topics'];
if (!SUPPORTED.includes(type)) {
    throw new InvalidParameterError(`Unsupported type: ${type}. Supported: ${SUPPORTED.join(', ')}`);
}
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['episodes', 'comments', 'blogs', 'topics'] as const;
if (!SUPPORTED.includes(type)) {
    throw new InvalidParameterError(`Unsupported type: ${type}. Supported: ${SUPPORTED.join(', ')}`);
}

Type guard

const SUPPORTED_TYPES = new Set(['episodes', 'comments', 'blogs', 'topics']);
function isSupportedType(v: string): boolean {
    return SUPPORTED_TYPES.has(v);
}

Prevention

When it happens

Trigger: Requesting the route with a type value outside {episodes, comments, blogs, topics}, e.g. 'reviews', 'characters', or a typo like 'comment'.

Common situations: User assumes every Bangumi subject tab has a feed; outdated example URL; new Bangumi feature requested but not implemented.

Related errors


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