{"record":{"id":"b63b681675118aab","repo":"babalae/better-genshin-impact","slug":"repo-json-b63b68","errorCode":null,"errorMessage":"repo.json 仓库索引文件不存在，请至少成功更新一次仓库！","messagePattern":"repo\\.json 仓库索引文件不存在，请至少成功更新一次仓库！","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"warning","filePath":"BetterGenshinImpact/Core/Script/WebView/RepoWebBridge.cs","lineNumber":264,"sourceCode":"            Console.WriteLine(e);\n            return false;\n        }\n    }\n\n    private static string GetRepoJsonPath()\n    {\n        string updatedRepoJsonPath = ScriptRepoUpdater.RepoUpdatedJsonPath;\n\n        if (File.Exists(updatedRepoJsonPath))\n        {\n            return updatedRepoJsonPath;\n        }\n\n        string? repoJson = Directory\n            .GetFiles(ScriptRepoUpdater.CenterRepoPath, \"repo.json\", SearchOption.AllDirectories)\n            .FirstOrDefault();\n\n        return repoJson ?? throw new FileNotFoundException(\"repo.json 仓库索引文件不存在，请至少成功更新一次仓库！\");\n    }\n\n    internal static void ProcessPathRecursively(JArray array, string[] pathParts, int currentIndex)\n    {\n        foreach (JObject item in array.OfType<JObject>())\n        {\n            if (item[\"name\"]?.ToString() != pathParts[currentIndex]) continue;\n            \n            if (currentIndex == pathParts.Length - 1)\n            {\n                ResetHasUpdateFlag(item);\n            }\n            else if (item[\"children\"] is JArray children)\n            {\n                ProcessPathRecursively(children, pathParts, currentIndex + 1);\n            }\n            break;\n        }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/WebView/RepoWebBridge.cs#L246-L282","documentation":"Thrown by the private GetRepoJsonPath helper: it first tries ScriptRepoUpdater.RepoUpdatedJsonPath, and if absent, falls back to a recursive search for repo.json under CenterRepoPath. If neither exists it throws FileNotFoundException. This helper feeds GetRepoJson and UpdateSubscribed, so the message surfaces inside their catch blocks.","triggerScenarios":"No local repo.json and no RepoUpdatedJsonPath — i.e. repo never updated, or updated but the json was deleted/never written. Reached when CenterRepoPath exists (else 142/143 would fire first) but contains no repo.json anywhere beneath it.","commonSituations":"First run without an update; partial update that created the folder but failed before writing repo.json; RepoUpdatedJsonPath cleared by ClearUpdate then the source repo.json deleted.","solutions":["Perform a full repository update to materialize repo.json and RepoUpdatedJsonPath.","If only RepoUpdatedJsonPath is missing, run ClearUpdate to copy repo.json back, but first confirm repo.json exists (else 144).","Check write permissions and disk space under CenterRepoPath so the update can persist the json.","Re-clone the repo if the folder is corrupt."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static bool RepoJsonAvailable() =>\n    File.Exists(ScriptRepoUpdater.RepoUpdatedJsonPath) ||\n    Directory.Exists(ScriptRepoUpdater.CenterRepoPath) &&\n    Directory.GetFiles(ScriptRepoUpdater.CenterRepoPath, \"repo.json\", SearchOption.AllDirectories).Length > 0;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure a successful repo update before reading repo.json.","Run ClearUpdate to regenerate RepoUpdatedJsonPath from repo.json.","Treat a missing repo.json as 'update required', not a crash."],"tags":["repo","filesystem","webview","first-run"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}