{"record":{"id":"98a912d3d43172d5","repo":"babalae/better-genshin-impact","slug":"error-98a912","errorCode":null,"errorMessage":"战斗策略文件不存在","messagePattern":"战斗策略文件不存在","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoPathing/Handler/AutoFightHandler.cs","lineNumber":93,"sourceCode":"    }\n\n    private AutoFightParam GetFightAutoFightParam(AutoFightConfig? config)\n    {\n        AutoFightParam autoFightParam = new AutoFightParam(GetFightStrategy(config), config);\n        return autoFightParam;\n    }\n\n    private string GetFightStrategy(AutoFightConfig config)\n    {\n        if (\"根据队伍自动选择\".Equals(config.StrategyName) || string.IsNullOrEmpty(config.StrategyName))\n        {\n            return Global.Absolute(@\"User\\AutoFight\\\");\n        }\n\n        var (path, _) = AutoFightParam.ResolveStrategyPath(config.StrategyName);\n        if (!File.Exists(path))\n        {\n            throw new Exception(\"战斗策略文件不存在\");\n        }\n\n        return path;\n    }\n\n    private string GetFightStrategy()\n    {\n        return GetFightStrategy(TaskContext.Instance().Config.AutoFightConfig);\n    }\n}","sourceCodeStart":75,"sourceCodeEnd":103,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoPathing/Handler/AutoFightHandler.cs#L75-L103","documentation":"Thrown by AutoFightHandler.GetFightStrategy when config.StrategyName is set (not empty and not '根据队伍自动选择'), AutoFightParam.ResolveStrategyPath resolves a file path, but File.Exists(path) is false. The combat strategy file referenced by the pathing/auto-fight config is missing.","triggerScenarios":"GetFightStrategy(config) with a concrete StrategyName; ResolveStrategyPath returns a path; File.Exists is false → throw. (Note: unlike the ley-line variant 267, this only checks File.Exists, not Directory.Exists.)","commonSituations":"Strategy file deleted/renamed; fresh install missing User\\AutoFight strategy files; StrategyName in the party/auto-fight config points to a nonexistent file.","solutions":["Verify the resolved path exists (log ResolveStrategyPath's output).","Restore the strategy file under User\\AutoFight.","Set StrategyName to '根据队伍自动选择' or empty to use directory-based auto selection.","Create the missing strategy file or pick an existing one."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var (path, _) = AutoFightParam.ResolveStrategyPath(config.StrategyName);\nif (!File.Exists(path))\n{\n    throw new FileNotFoundException($\"战斗策略文件不存在: {path}\", path);\n}","typeGuard":"bool FightStrategyFileExists(string strategyName)\n{\n    if (string.IsNullOrEmpty(strategyName) || strategyName == \"根据队伍自动选择\") return true;\n    var (p, _) = AutoFightParam.ResolveStrategyPath(strategyName);\n    return File.Exists(p);\n}","tryCatchPattern":null,"preventionTips":["Check strategy file existence at config/party load time.","Ship default strategy files under User\\\\AutoFight and verify in CI.","Default to '根据队伍自动选择' when a named strategy is absent."],"tags":["config","file","combat","strategy","pathing"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}