{"record":{"id":"f1506c23f528852a","repo":"DIYgod/RSSHub","slug":"invalid-page-requestedpage","errorCode":null,"errorMessage":"Invalid page '${requestedPage}'","messagePattern":"Invalid page '(.+?)'","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":400,"severity":"error","filePath":"lib/routes/people/paper.ts","lineNumber":117,"sourceCode":"            target: '/paper',\n        },\n    ],\n    name: '人民日报电子版',\n    maintainers: ['pseudoyu'],\n    handler,\n    url: 'paper.people.com.cn/rmrb/pc/layout/index.html',\n    description: '获取当日《人民日报》全部版面或指定版面的文章。',\n};\n\nasync function handler(ctx) {\n    const requestedPage = ctx.req.param('page') ?? 'all';\n    const limit = Number(ctx.req.query('limit') ?? defaultLimit);\n    const pages = await getPages();\n    const normalizedPage = /^\\d{1,2}$/.test(requestedPage) ? requestedPage.padStart(2, '0') : requestedPage;\n    const selectedPage = normalizedPage === 'all' ? undefined : pages.find((page) => page.id === normalizedPage);\n\n    if (normalizedPage !== 'all' && !selectedPage) {\n        throw new InvalidParameterError(`Invalid page '${requestedPage}'`);\n    }\n\n    const editionDate = getEditionDate(pages[0].url);\n    const pubDate = parseDate(editionDate, 'YYYY年MM月DD日');\n    const targetPages = selectedPage ? [selectedPage] : pages;\n    const articleLists = await Promise.all(targetPages.map((page) => getArticles(page, pubDate)));\n    const articles = articleLists.flat().slice(0, limit);\n    const items = await Promise.all(articles.map((article) => getArticleDetail(article)));\n\n    return {\n        title: `人民日报电子版${selectedPage ? ` - ${selectedPage.title}` : ''} - ${editionDate}`,\n        link: selectedPage?.url ?? indexUrl,\n        item: items,\n    };\n}\n","sourceCodeStart":99,"sourceCodeEnd":133,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/people/paper.ts#L99-L133","documentation":"Error \"Invalid page '${requestedPage}'\" thrown in DIYgod/RSSHub.","triggerScenarios":"The requested page parameter does not match any page id available in the current People’s Daily edition.","commonSituations":"See trigger scenarios.","solutions":["Use a valid page number (e.g. 01) listed in the current edition, or use 'all' / omit the parameter to get all pages."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}