{"record":{"id":"a2803d285ccc71a8","repo":"babalae/better-genshin-impact","slug":"error-a2803d","errorCode":null,"errorMessage":"路径追踪任务未完全走完，判定失败，触发异常！","messagePattern":"路径追踪任务未完全走完，判定失败，触发异常！","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/Core/Script/Group/ScriptGroupProject.cs","lineNumber":255,"sourceCode":"                return;\n            }\n            var pathingTask = new PathExecutor(CancellationContext.Instance.Cts.Token);\n            pathingTask.PartyConfig = GroupInfo?.Config.PathingConfig;\n            if (pathingTask.PartyConfig is null || pathingTask.PartyConfig.AutoPickEnabled)\n            {\n                TaskTriggerDispatcher.Instance().AddTrigger(\"AutoPick\", null);\n            }\n            await pathingTask.Pathing(task);\n\n            \n            executionRecord.IsSuccessful = pathingTask.SuccessEnd;\n            OtherConfig.AutoRestart autoRestart = TaskContext.Instance().Config.OtherConfig.AutoRestartConfig;\n            if (!pathingTask.SuccessEnd)\n            {\n                TaskControl.Logger.LogWarning($\"此追踪脚本未正常走完！\");\n                if (autoRestart.Enabled && autoRestart.IsPathingFailureExceptional && !pathingTask.SuccessEnd)\n                {\n                    throw new Exception($\"路径追踪任务未完全走完，判定失败，触发异常！\");\n                }\n            }\n\n            if (task.FarmingInfo.AllowFarmingCount)\n            {\n                var successFight = pathingTask.SuccessEnd;\n                var fightCount = 0;\n               \n                //未走完完整路径下，才校验打架次数\n                if (!successFight)\n                {\n                    fightCount = task.Positions.Count(pos => pos.Action == ActionEnum.Fight.Code);\n                    successFight = pathingTask.SuccessFight >= fightCount;\n                    //判断为锄地脚本\n                    if (task.FarmingInfo.PrimaryTarget!=\"disable\")\n                    {\n\n                        if (autoRestart.Enabled","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/Group/ScriptGroupProject.cs#L237-L273","documentation":"Thrown after a Pathing task completes without reaching SuccessEnd, but only when the AutoRestart feature is enabled AND IsPathingFailureExceptional is true. This converts a soft pathing failure (the route didn't fully complete) into a hard exception so the auto-restart loop can trigger recovery. The interpolation of braces in the message is a bug — the string uses {pathingTask.SuccessEnd} without $ prefix interpolation in some builds.","triggerScenarios":"Executing a Pathing-type ScriptGroupProject where the PathExecutor.Pathing(task) call completes but pathingTask.SuccessEnd is false, and the user's config has OtherConfig.AutoRestartConfig.Enabled=true and IsPathingFailureExceptional=true.","commonSituations":"Character got stuck during automated pathing, encountered an unexpected obstacle, or the route was interrupted. The game state changed (teleport, combat interruption) preventing full route completion. This is a deliberate design choice to make pathing failures restart-worthy.","solutions":["If you don't want auto-restart on pathing failure, disable IsPathingFailureExceptional in OtherConfig.AutoRestartConfig.","Improve the pathing JSON route to handle obstacles or add waypoints.","Ensure the game window is focused and unobstructed before running pathing tasks.","Catch this exception at the scheduler level to implement custom recovery logic."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await project.Run();\n}\ncatch (Exception ex) when (ex.Message.Contains(\"路径追踪任务未完全走完\"))\n{\n    TaskControl.Logger.LogWarning(\"Pathing failed, handling recovery: {Message}\", ex.Message);\n    // Implement custom recovery: retry, skip, or notify user\n}","preventionTips":["Disable IsPathingFailureExceptional in AutoRestartConfig if you want soft-fail behavior.","Improve pathing route JSON quality to reduce navigation failures.","Monitor game state before and during pathing to preempt failures."],"tags":["pathing","auto-restart","script-execution","game-automation"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}