{"record":{"id":"e8b588b7f9b41bdc","repo":"DIYgod/RSSHub","slug":"invalid-forum-id-fid","errorCode":null,"errorMessage":"Invalid forum id '${fid}'","messagePattern":"Invalid forum id '(.+?)'","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":400,"severity":"warning","filePath":"lib/routes/people/liuyan.ts","lineNumber":69,"sourceCode":"        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: '领导留言板',\n    maintainers: ['nczitzk', 'pseudoyu'],\n    handler,\n    url: 'liuyan.people.com.cn/',\n    description: `| 全部 | 待回复 | 办理中 | 已办理 |\n| ---- | ------ | ------ | ------ |\n| 1    | 2      | 3      | 4      |`,\n};\n\nasync function handler(ctx) {\n    const fid = ctx.req.param('id');\n    if (!/^\\d+$/.test(fid)) {\n        throw new InvalidParameterError(`Invalid forum id '${fid}'`);\n    }\n\n    const state = ctx.req.param('state') ?? '1';\n    if (!allowedStates.has(state)) {\n        throw new InvalidParameterError(`Invalid state '${state}'`);\n    }\n\n    const limit = Number(ctx.req.query('limit') ?? 30);\n    const forumUrl = `${rootUrl}/threads/list?fid=${fid}`;\n    const currentUrl = `${forumUrl}#state=${state}`;\n    const apiResponse = await ofetch<ApiResponse>(apiUrl, {\n        method: 'POST',\n        responseType: 'json',\n        headers: {\n            Referer: forumUrl,\n        },\n        body: new URLSearchParams({\n            fid,","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/people/liuyan.ts#L51-L87","documentation":"Thrown as an `InvalidParameterError` when the `id` path parameter (forum ID) for the People's Daily message board (领导留言板) route does not match the regex `/^\\d+$/`. The forum ID must be a string of one or more digits only. The `fid` is used directly in API requests to `liuyan.people.com.cn`.","triggerScenarios":"Requesting `/people/liuyan/<id>/<state>?` with an `id` containing non-digit characters (letters, symbols, spaces, decimals). Examples: `id='abc'`, `id='539a'`, `id='53.9'`. Note: the ID should be found in the person's page URL on liuyan.people.com.cn.","commonSituations":"User passes a URL slug or name instead of the numeric forum ID. User includes a leading slash or other separator. The ID was extracted incorrectly from the website URL.","solutions":["Find the numeric forum ID from the corresponding person's page URL on liuyan.people.com.cn.","Ensure the ID is purely numeric (digits only).","Use the documented example `/people/liuyan/539` as a format reference."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate forum ID is numeric before use\nif (!/^\\d+$/.test(fid)) {\n    throw new InvalidParameterError(`Invalid forum id '${fid}'. Must be numeric.`);\n}","typeGuard":"function isValidForumId(fid: string): boolean {\n    return /^\\d+$/.test(fid);\n}","tryCatchPattern":null,"preventionTips":["Extract the numeric forum ID from the person's page URL on liuyan.people.com.cn.","Ensure the ID contains only digits.","Use the documented example /people/liuyan/539 as a format reference."],"tags":["validation","people","invalid-parameter","chinese-site","liuyan"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}