Improve error handling in ResetAllFiles function by logging warnings for failed file writes instead of returning errors
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user