{"record":{"id":"6b2882d6f946e2fb","repo":"babalae/better-genshin-impact","slug":"error-6b2882","errorCode":null,"errorMessage":"领取奖励失败","messagePattern":"领取奖励失败","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":1680,"sourceCode":"            return false;\n        }\n\n        _switchPartyTask ??= new SwitchPartyTask();\n        var success = await _switchPartyTask.Start(partyName, _ct);\n        if (success)\n        {\n            RunnerContext.Instance.PartyName = partyName;\n        }\n\n        return success;\n    }\n\n    private async Task<bool> AttemptReward(int retryCount = 0)\n    {\n        const int maxRetry = 3;\n        if (retryCount >= maxRetry)\n        {\n            throw new Exception(\"领取奖励失败\");\n        }\n\n        Simulation.SendInput.SimulateAction(GIActions.PickUpOrInteract);\n        await Delay(800, _ct);\n\n        if (!await VerifyRewardPage())\n        {\n            await _returnMainUiTask.Start(_ct);\n            await AutoNavigateToReward();\n            return await AttemptReward(retryCount + 1);\n        }\n\n        if (!await TryUseRewardResin())\n        {\n            await EnsureExitRewardPage();\n            return false;\n        }\n","sourceCodeStart":1662,"sourceCodeEnd":1698,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L1662-L1698","documentation":"Thrown by AttemptReward when its recursive retry counter reaches maxRetry (3). Each attempt sends the interact key, waits, then calls VerifyRewardPage; when verification keeps failing it returns to the main UI, re-navigates, and retries — all three attempts failed to confirm the reward page.","triggerScenarios":"AttemptReward(retryCount) with retryCount >= 3 → throw. The recursion increments retryCount whenever VerifyRewardPage returns false.","commonSituations":"The interact key press isn't registering (input desync); the reward page opens but VerifyRewardPage's template doesn't match; UI lag/animation causing the verify to run too early.","solutions":["Confirm the reward/claim UI template used by VerifyRewardPage still matches the current game version.","Ensure input injection is working (focus on the game window, no input-blocking overlays).","Increase the 800ms delay before VerifyRewardPage if the UI animates slowly.","Re-run the task when the game is responsive."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await AttemptReward(); }\ncatch (Exception ex) when (ex.Message == \"领取奖励失败\")\n{\n    _logger.LogWarning(\"领取奖励内部重试耗尽，重新导航后再试\");\n    await _returnMainUiTask.Start(_ct);\n    await AutoNavigateToReward();\n    await AttemptReward();\n}","preventionTips":["Confirm VerifyRewardPage's template matches the current game version.","Ensure input injection reaches the game (no overlay stealing focus).","Allow enough delay for the reward UI animation before verifying."],"tags":["retry","reward","interaction","ley-line"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}