{"record":{"id":"c7cec6e4de7943a8","repo":"babalae/better-genshin-impact","slug":"error-c7cec6","errorCode":null,"errorMessage":"国家未配置","messagePattern":"国家未配置","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":191,"sourceCode":"    }\n\n    private void ValidateSettings()\n    {\n        _taskParam.FightConfig ??= new AutoLeyLineOutcropFightConfig();\n\n        if (string.IsNullOrWhiteSpace(_taskParam.LeyLineOutcropType))\n        {\n            throw new Exception(\"地脉花类型未选择\");\n        }\n\n        if (_taskParam.LeyLineOutcropType != \"启示之花\" && _taskParam.LeyLineOutcropType != \"藏金之花\")\n        {\n            throw new Exception(\"地脉花类型无效，请重新选择\");\n        }\n\n        if (string.IsNullOrWhiteSpace(_taskParam.Country))\n        {\n            throw new Exception(\"国家未配置\");\n        }\n\n        if (!string.IsNullOrWhiteSpace(_taskParam.FriendshipTeam) && string.IsNullOrWhiteSpace(_taskParam.Team))\n        {\n            throw new Exception(\"配置好感队时必须配置战斗队伍\");\n        }\n\n        if (_taskParam.Count < 1)\n        {\n            _taskParam.Count = 1;\n        }\n\n        if (string.IsNullOrWhiteSpace(_taskParam.FightConfig.StrategyName) && _taskParam.Timeout > 0)\n        {\n            _taskParam.FightConfig.Timeout = _taskParam.Timeout;\n        }\n\n        if (_taskParam.FightConfig.Timeout <= 0)","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L173-L209","documentation":"Thrown by ValidateSettings when _taskParam.Country is null, empty, or whitespace. The Country field selects which region's ley line positions to navigate to (e.g. '蒙德', '璃月', '稻妻', '须弥', '枫丹'). The task uses it as a dictionary key into _configData.LeyLinePositions and _configData.MapPositions. Without a country the task cannot determine which map region to search or which pathing routes to use.","triggerScenarios":"AutoLeyLineOutcropParam was constructed or deserialized without setting Country. ValidateSettings is the first code to run in Initialize and checks Country after the ley line type validations.","commonSituations":"User selected a ley line type but did not select a country/region in the UI; a configuration file or script omitted the Country field; the country dropdown defaulted to empty.","solutions":["Select a country/region in the ley line task configuration before starting.","Set taskParam.Country to one of the supported region names (e.g. \"蒙德\", \"璃月\", \"稻妻\", \"须弥\", \"枫丹\").","If loading from JSON, ensure the Country field is present and correctly spelled in Simplified Chinese."],"exampleFix":"// before\nvar param = new AutoLeyLineOutcropParam { LeyLineOutcropType = \"启示之花\" };\n// Country missing\n\n// after\nvar param = new AutoLeyLineOutcropParam\n{\n    LeyLineOutcropType = \"启示之花\",\n    Country = \"蒙德\"\n};","handlingStrategy":"validation","validationCode":"// Before starting, validate the country is set\nif (string.IsNullOrWhiteSpace(taskParam.Country))\n{\n    Logger.LogError(\"请选择国家/地区\");\n    return;\n}","typeGuard":"public static bool HasValidCountry(AutoLeyLineOutcropParam param)\n{\n    return !string.IsNullOrWhiteSpace(param.Country);\n}","tryCatchPattern":null,"preventionTips":["Always select a country/region in the task configuration UI before starting.","If constructing params programmatically, set Country explicitly.","Ensure the country name matches one of the keys in config.json's LeyLinePositions."],"tags":["ley-line","validation","configuration","param"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}