Improve error handling in ResetAllFiles function by logging warnings for failed file writes instead of returning errors

This commit is contained in:
2025-07-27 12:47:21 +02:00
parent bb69558aaa
commit 91993b4548

View File

@@ -86,7 +86,8 @@ func ResetAllFiles(db DB) error {
log.Debug("Resetting file %q", fileSnapshot.FilePath) log.Debug("Resetting file %q", fileSnapshot.FilePath)
err = os.WriteFile(fileSnapshot.FilePath, fileSnapshot.FileData, 0644) err = os.WriteFile(fileSnapshot.FilePath, fileSnapshot.FileData, 0644)
if err != nil { if err != nil {
return err log.Warning("Failed to write file %q: %v", fileSnapshot.FilePath, err)
continue
} }
log.Debug("File %q written to disk", fileSnapshot.FilePath) log.Debug("File %q written to disk", fileSnapshot.FilePath)
} }