{"record":{"id":"774976c174fe97a6","repo":"babalae/better-genshin-impact","slug":"country-774976","errorCode":null,"errorMessage":"冒险之证未找到国家: {country}","messagePattern":"冒险之证未找到国家: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":2303,"sourceCode":"    {\n        if (_mapSettingButtonRo == null)\n        {\n            return false;\n        }\n\n        using var capture = CaptureToRectArea();\n        return capture.Find(_mapSettingButtonRo).IsExist();\n    }\n\n    private async Task FindAndClickCountry(string country)\n    {\n        var match = country == \"挪德卡莱\" ? \"挪德卡\" : country;\n        using var capture = CaptureToRectArea();\n        var list = capture.FindMulti(_ocrRoThis);\n        var target = list.FirstOrDefault(r => r.Text.Contains(match, StringComparison.Ordinal));\n        if (target == null)\n        {\n            throw new Exception($\"冒险之证未找到国家: {country}\");\n        }\n\n        target.Click();\n    }\n\n    private async Task<bool> TryOpenBigMapFromHandbook()\n    {\n        for (var attempt = 0; attempt < 2; attempt++)\n        {\n            var button = FindHandbookTrackActionButtonByIcon();\n            if (button == null)\n            {\n                break;\n            }\n\n            button.Click();\n            _logger.LogDebug(\"通过图标识别点击冒险之证底部操作按钮，第{Attempt}次\", attempt + 1);\n            await Delay(1500, _ct);","sourceCodeStart":2285,"sourceCodeEnd":2321,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L2285-L2321","documentation":"Thrown by FindAndClickCountry when OCR over the handbook country list finds no entry whose Text contains the target country substring. Note the special-case mapping where '挪德卡莱' is searched as '挪德卡'.","triggerScenarios":"capture.FindMulti(_ocrRoThis) returns a list; FirstOrDefault with r.Text.Contains(match) yields null → throw. match = (country == \"挪德卡莱\" ? \"挪德卡\" : country).","commonSituations":"OCR misreads the country name; the handbook isn't scrolled to show the target country; the country isn't unlocked in the player's handbook; UI text changed.","solutions":["Ensure the handbook is scrolled so the target country is visible before OCR.","Improve OCR accuracy (resolution, language, ROI) so country names read correctly.","Verify the country string passed matches in-game text (and the 挪德卡莱→挪德卡 abbreviation rule still applies).","Confirm the player has unlocked that country's handbook entries."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await FindAndClickCountry(country); }\ncatch (Exception ex) when (ex.Message.Contains(\"冒险之证未找到国家\"))\n{\n    _logger.LogWarning(\"未在冒险之证识别到国家 {Country}，尝试滚动后重试\", country);\n    // scroll handbook list, then retry\n}","preventionTips":["Scroll the handbook so the target country is in the OCR ROI before searching.","Use a robust OCR ROI and confidence threshold for country names.","Confirm the country is unlocked in the player's handbook."],"tags":["ocr","handbook","ui","ley-line"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}