1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Catch os... errors

This commit is contained in:
Bwko
2016-12-01 00:56:15 +01:00
committed by Kim "BKC" Carlbäcker
parent 5ab85372da
commit 4ff0db0246
14 changed files with 123 additions and 29 deletions

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