{"record":{"id":"dc316ecfcd750031","repo":"babalae/better-genshin-impact","slug":"repo-json-dc316e","errorCode":null,"errorMessage":"找不到原始 repo.json 文件","messagePattern":"找不到原始 repo\\.json 文件","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"warning","filePath":"BetterGenshinImpact/Core/Script/WebView/RepoWebBridge.cs","lineNumber":205,"sourceCode":"        }\n        catch (Exception ex)\n        {\n            await ThemedMessageBox.ErrorAsync(ex.Message, \"信息更新失败\");\n            return false;\n        }\n    }\n    \n    public async Task<bool> ClearUpdate()\n    {\n        try\n        {\n            string? repoJsonPath = Directory\n                .GetFiles(ScriptRepoUpdater.CenterRepoPath, \"repo.json\", SearchOption.AllDirectories)\n                .FirstOrDefault();\n\n            if (string.IsNullOrEmpty(repoJsonPath))\n            {\n                throw new FileNotFoundException(\"找不到原始 repo.json 文件\");\n            }\n\n            string targetPath = ScriptRepoUpdater.RepoUpdatedJsonPath;\n\n            File.Copy(repoJsonPath, targetPath, overwrite: true);\n\n            return true;\n        }\n        catch (Exception ex)\n        {\n            await ThemedMessageBox.ErrorAsync($\"清空更新标记失败: {ex.Message}\", \"操作失败\");\n            return false;\n        }\n    }\n\n    // 设置新手引导标志位\n    public bool SetGuideStatus(bool status)\n    {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/Core/Script/WebView/RepoWebBridge.cs#L187-L223","documentation":"Thrown by RepoWebBridge.ClearUpdate when a recursive Directory.GetFiles(CenterRepoPath, 'repo.json', AllDirectories) returns no match. ClearUpdate copies the pristine repo.json over RepoUpdatedJsonPath to wipe local 'hasUpdate' edits. The FileNotFoundException is caught and shown as '清空更新标记失败'.","triggerScenarios":"CenterRepoPath exists but the inner 'repo' subfolder (or the repo.json inside it) is missing — e.g. a partial/empty clone, a corrupted extraction, or the repo layout changed and repo.json moved. Distinct from 142/143 because the folder exists but the index file does not.","commonSituations":"Repo update was interrupted leaving an empty directory; user deleted repo.json manually; git clone succeeded but checkout left only metadata; repo schema migration removed the file.","solutions":["Re-run the repository update to restore repo.json under CenterRepoPath.","Validate the repo folder layout (expect .../repo/repo.json) and report if the structure differs.","If repo.json lives elsewhere, update ClearUpdate's search pattern or the repo manifest.","Delete CenterRepoPath and re-clone from scratch to eliminate corruption."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool HasRepoJson() => Directory.Exists(ScriptRepoUpdater.CenterRepoPath) &&\n    Directory.GetFiles(ScriptRepoUpdater.CenterRepoPath, \"repo.json\", SearchOption.AllDirectories).Length > 0;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate repo.json presence before offering ClearUpdate.","Re-clone if the file is missing after an update.","Check repo folder integrity after updates."],"tags":["repo","filesystem","webview","data-integrity"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}