优化错误处理相关代码

This commit is contained in:
刘祥超
2023-08-11 14:51:23 +08:00
parent 2eee314ec8
commit 70d8507c4b
10 changed files with 16 additions and 17 deletions

View File

@@ -540,7 +540,7 @@ func (this *FileListDB) WrapError(err error) error {
if err == nil {
return nil
}
return errors.New(err.Error() + "(file: " + this.dbPath + ")")
return fmt.Errorf("%w (file: %s)", err, this.dbPath)
}
// 初始化