DIYgod/RSSHub · warning · InvalidParameterError

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

Error message

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

What it means

Thrown as an `InvalidParameterError` when the `type` path parameter for the NUA (Nanjing University of the Arts) Design College route does not match any of the supported `case` branches in the switch statement. The switch covers specific page types for the design school, and the default branch throws.

Source

Thrown at lib/routes/nua/dc.ts:85

            listName = 'div.pre65.left p.small_content_2';
            listDate = '.date';
            artiContent = '.article';
            webPageName = 'div.pre65.left.is-inview .big_title';
            break;
        case 'party':
            listName = 'div.pre35.right li.party_list';
            listDate = '.date';
            artiContent = '.article';
            webPageName = 'div.pre35.right .big_title';
            break;
        case 'youth':
            listName = 'ul.works_list p.small_content_2.viewpoint';
            listDate = '.date';
            artiContent = '.article';
            webPageName = 'ul.screen_4 .big_title';
            break;
        default:
            throw new InvalidParameterError(`暂不支持对${type}的订阅`);
    }

    const items = await util.ProcessList(baseUrl, baseUrl, listName, listDate, webPageName);
    const results = await util.ProcessFeed(items[0], artiContent);

    return {
        title: 'NUA-设计学院-' + items[1],
        link: baseUrl,
        description: '南京艺术学院 设计学院 ' + items[1],
        item: results,
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Check the switch statement in `lib/routes/nua/dc.ts` for the list of supported type values.
  2. Browse the NUA design college website to find the correct type identifier for the desired section.
  3. If a new section exists, add a new `case` branch with the appropriate CSS selectors.
Defensive patterns

Strategy: validation

Validate before calling

// Validate type against known switch cases before processing
const validDcTypes = new Set(['news', 'notice', /* ...all case labels from the switch */]);
if (!validDcTypes.has(type)) {
    throw new InvalidParameterError(`暂不支持对${type}的订阅`);
}

Type guard

function isSupportedDcType(type: string): boolean {
    // Add all case labels from the switch in dc.ts
    return ['news', 'notice'].includes(type);
}

Prevention

When it happens

Trigger: A user requests the NUA dc route with a `type` value that is not one of the predefined case labels (the cases assign CSS selectors like 'div.pre35.right li.party_list' for specific sub-pages). The route path uses `type` to select which section of the design college website to scrape.

Common situations: User passes an arbitrary or misspelled type value. The website restructured its sections and a previously valid type is no longer in the switch. A radar rule references an unsupported type.

Related errors


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