DIYgod/RSSHub · error · InvalidParameterError

新闻信息不存在,请报告这个问题

Error message

新闻信息不存在,请报告这个问题

What it means

Sibling guard to 407, in the Nintendo CN news route. After nuxtReader extracts the payload, the handler requires result.newsList; absence throws InvalidParameterError with a 'report this' message. Same root cause as 407: upstream Nuxt payload changed shape or the page is in an error state.

Source

Thrown at lib/routes/nintendo/news-china.ts:47

    maintainers: ['NeverBehave'],
    handler,
    url: 'nintendoswitch.com.cn/',
};

async function handler() {
    const response = await got(news_url);

    // 获取Nuxt对象
    const result: any = await util.nuxtReader(response.data);

    /* newsList[]
        imgUrl: "https://metadata-images.nintendoswitch.com.cn/formal/8332123215251-EAFBA647-9772-DB4B-3C1A-FE0CC41A3966-封面图(1).jpg"
        jumpUrl: "0691bb11-e6a0-4e8c-9b0b-80470ec0a939"
        publishTime: "2022.11.08 11:30:00" // 1667878200000
        title: "8款新品开启预约:超级马力欧系列官方周边"
    */
    if (!result.newsList) {
        throw new InvalidParameterError('新闻信息不存在,请报告这个问题');
    }

    let data = result.newsList.map((item) => ({
        title: item.title,
        description: util.generateImageLink(item.imgUrl),
        link: `${news_url}/topics/${item.jumpUrl}`,
    }));

    data = await util.ProcessNewsChina(data, cache);

    return {
        title: 'Nintendo(中国大陆)主页资讯',
        link: 'https://www.nintendoswitch.com.cn',
        description: 'Nintendo 中国大陆官网刊登的资讯',
        item: data,
    };
}

View on GitHub (pinned to bed535e087)

Solutions

  1. Inspect window.__NUXT__ on the live news URL to confirm newsList key name and data index.
  2. Update the key name / index if it drifted.
  3. If the list is legitimately empty, return an empty feed instead of throwing.
  4. Report upstream to route maintainers.

Example fix

// before
if (!result.newsList) {
    throw new InvalidParameterError('新闻信息不存在,请报告这个问题');
}

// after
if (!result.newsList) {
    throw new Error('Nintendo CN news: newsList missing from Nuxt payload (structure changed)');
}
Defensive patterns

Strategy: try-catch

Type guard

const hasNewsList = (r: any): r is { newsList: any[] } =>
  !!r && Array.isArray(r.newsList);

Try / catch

try {
  const result: any = await util.nuxtReader(response.data);
  if (!result.newsList) throw new Error('Nintendo CN news: newsList missing — structure changed');
} catch (e) {
  // report upstream; consider empty-feed fallback
}

Prevention

When it happens

Trigger: The news page's __NUXT__ payload lacks newsList — redesign, maintenance page, regional content change, or nuxtReader returning the wrong data index. Distinct from 409 (which fires when Nuxt extraction itself fails).

Common situations: Nintendo CN ships a redesign that renames newsList; the page serves a cached/error payload that still parses as Nuxt; data index drift in nuxtReader.

Related errors


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