{"record":{"id":"61e3b72a8e383f48","repo":"babalae/better-genshin-impact","slug":"error-61e3b7","errorCode":null,"errorMessage":"前瞻直播数据异常","messagePattern":"前瞻直播数据异常","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/UseRedeemCode/GetLiveRedeemCode.cs","lineNumber":176,"sourceCode":"        return result;\n    }\n\n    /// <summary>\n    /// 获取前瞻直播兑换码信息。返回格式：List[(\"奖励内容\", \"兑换码\")]\n    /// </summary>\n    public async Task<List<RedeemCode>> GetCodeMsgAsync()\n    {\n        string actId = await GetActIdAsync(\"1\");\n        if (string.IsNullOrEmpty(actId))\n        {\n            actId = await GetActIdAsync(\"2\");\n            if (string.IsNullOrEmpty(actId))\n                throw new Exception(\"暂无前瞻直播资讯！\");\n        }\n\n        var (codeVer, title) = await GetLiveDataAsync(actId);\n        if (string.IsNullOrEmpty(codeVer))\n            throw new Exception(\"前瞻直播数据异常\");\n        var codeList = await GetCodeAsync(codeVer, actId);\n        return codeList;\n    }\n}\n","sourceCodeStart":158,"sourceCodeEnd":181,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/UseRedeemCode/GetLiveRedeemCode.cs#L158-L181","documentation":"A generic Exception from GetCodeMsgAsync thrown when an actId was resolved but GetLiveDataAsync returned an empty codeVer. The activity index responded (retcode 0, a live block exists) but the code_ver field is missing or empty, so the code-fetch step cannot proceed. This points to an unexpected/changed response shape rather than 'no activity'.","triggerScenarios":"GetLiveDataAsync returns a non-null live object whose code_ver is null/empty (the live entry exists but code_ver is not published yet), or the response JSON shape changed so code_ver is no longer under data.live.code_ver.","commonSituations":"The livestream was announced but redeem codes are not yet published (code_ver blank); an upstream API schema change moved/renamed code_ver; partial/malformed response cached or returned.","solutions":["Retry later once the codes are actually published (code_ver populated).","Verify the JSON path data.live.code_ver still matches the upstream contract; update GetLiveDataAsync if it changed.","Catch the exception and inform the user that livestream data is temporarily unavailable.","Log the raw response (without secrets) once to confirm the shape."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"var (codeVer, _) = await GetLiveDataAsync(actId);\nif (string.IsNullOrEmpty(codeVer)) { /* data not published yet; retry later */ }","typeGuard":"null","tryCatchPattern":"try { var codes = await svc.GetCodeMsgAsync(); }\ncatch (Exception ex) { Toast.Warning(\"前瞻直播数据异常，请稍后重试\"); Log.Warning(ex.Message); }","preventionTips":["Retry once codes are actually published (codeVer populated).","Confirm the data.live.code_ver path still matches upstream.","Log the raw response shape once to detect schema drift."],"tags":["redeem-code","network","external-api","response-shape"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}