Catch os... errors

This commit is contained in:
Bwko authored and Kim "BKC" Carlbäcker committed 2016-12-02 07:41:19 +01:00
1 parent 5ab85372da
commit 4ff0db0246
14 files changed
+123 -29

No files matched your search

+4 -1
View File
@@ -219,7 +219,10 @@ func (w *FileLogWriter) deleteOldLog() {
if !info.IsDir() && info.ModTime().Unix() < (time.Now().Unix()-60*60*24*w.Maxdays) {
if strings.HasPrefix(filepath.Base(path), filepath.Base(w.Filename)) {
os.Remove(path)
if err := os.Remove(path); err != nil {
returnErr = fmt.Errorf("Fail to remove %s: %v", path, err)
}
}
}
return returnErr