{"record":{"id":"653510ad04ebb9c7","repo":"DIYgod/RSSHub","slug":"game-title","errorCode":null,"errorMessage":"${game_title} 的排行榜不存在！","messagePattern":"(.+?) 的排行榜不存在！","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/mihoyo/bbs/img-ranking.ts","lineNumber":116,"sourceCode":"排行榜类型\n\n| 日榜  | 周榜   | 月榜    |\n| ----- | ------ | ------- |\n| daily | weekly | monthly |`,\n};\n\nasync function handler(ctx) {\n    const game = ctx.req.param('game');\n    const routeParams = Object.fromEntries(new URLSearchParams(ctx.req.param('routeParams')));\n    const { forumType: forum_type = 'tongren', cateType: cate_type, rankingType: ranking_type, lastId: last_id = '' } = routeParams;\n    const page_size = ctx.req.query('limit') || '20';\n    const { gids, title: game_title } = getGameInfo(game);\n    if (!gids) {\n        throw new Error('未知的游戏！');\n    }\n    const { forum_id, title: forum_title } = getForumInfo(game, forum_type);\n    if (!forum_id) {\n        throw new Error(`${game_title} 的排行榜不存在！`);\n    }\n    const { cate_id, title: cate_title } = getCateInfo(game, forum_type, cate_type);\n    const { id: type, title: type_title } = getRankingTypeInfo(game, ranking_type);\n    const query = new URLSearchParams({\n        gids,\n        forum_id,\n        cate_id,\n        type,\n        page_size,\n        last_id,\n    }).toString();\n    const url = `https://bbs-api.miyoushe.com/post/wapi/getImagePostList?${query}`;\n    const response = await got({\n        method: 'get',\n        url,\n    });\n    const list = response?.data?.data?.list;\n    if (!list) {","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/mihoyo/bbs/img-ranking.ts#L98-L134","documentation":"Generic Error ('<game> 的排行榜不存在！' = 'ranking does not exist for <game>') thrown when the resolved forum_id is falsy. The game is known (375 passed) but the combination of game + forum_type does not map to a forum — e.g. requesting a 'cos' forum for a game that only has 'tongren'.","triggerScenarios":"getForumInfo(game, forum_type) returns forum_id undefined because DATA_MAP[game].forums[forum_type] is missing. The default forum_type is 'tongren'; only some games (ys, dby) have a 'cos' forum.","commonSituations":"Setting forumType=cos for a game without a COS ranking (e.g. bh2, wd); typo in forumType value; requesting a forum that was removed from DATA_MAP.","solutions":["Omit forumType or use forumType=tongren (the universal default).","Only use forumType=cos for games that document a COS榜 (ys, dby).","Check the route's description table for which forumType values each game supports.","Verify spelling: values are lowercase (tongren, cos)."],"exampleFix":"// before\n// /mihoyo/bbs/img-ranking/bh2/forumType=cos  -> bh2 has no cos forum\n\n// after\n// /mihoyo/bbs/img-ranking/bh2/forumType=tongren","handlingStrategy":"validation","validationCode":"const { forum_id } = getForumInfo(game, forum_type);\nif (!forum_id) {\n    throw new Error(`${game_title} has no forum '${forum_type}'. Use forumType=tongren.`);\n}","typeGuard":"function forumExists(game: string, forum_type: string): boolean {\n    return Boolean(DATA_MAP[game]?.forums?.[forum_type]?.forum_id);\n}","tryCatchPattern":null,"preventionTips":["Default forumType to 'tongren' (always valid).","Document per-game forum support in the route table.","Validate the combination before calling the API."],"tags":["mihoyo","validation","user-input"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}