refactor: better error handling for failed downloads

This commit is contained in:
zhom
2025-08-16 11:50:34 +04:00
parent c98e12900f
commit 96c42ae55e
3 changed files with 43 additions and 52 deletions
+4 -3
View File
@@ -1380,9 +1380,10 @@ impl BrowserRunner {
return Err(error_details.into());
}
registry
.mark_download_completed(&browser_str, &version)
.map_err(|e| format!("Failed to mark download as completed: {e}"))?;
// Mark completion in registry. If it fails (e.g., rare race during cleanup), log but continue.
if let Err(e) = registry.mark_download_completed(&browser_str, &version) {
eprintln!("Warning: Could not mark {browser_str} {version} as completed in registry: {e}");
}
registry
.save()
.map_err(|e| format!("Failed to save registry: {e}"))?;