优化错误处理相关代码

This commit is contained in:
GoEdgeLab
2023-08-11 14:38:00 +08:00
parent 9396fa5094
commit 85b6692548
17 changed files with 87 additions and 76 deletions

View File

@@ -259,7 +259,7 @@ func (this *FileStorage) Init() error {
} else {
err = os.MkdirAll(dir, 0777)
if err != nil {
return errors.New("[CACHE]can not create dir:" + err.Error())
return fmt.Errorf("[CACHE]can not create dir: %w", err)
}
}
}