mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
storage: DeleteFile should return errFileNotFound for ENOENT. (#2978)
This commit is contained in:
@@ -694,6 +694,11 @@ func deleteFile(basePath, deletePath string) error {
|
||||
}
|
||||
// Attempt to remove path.
|
||||
if err := os.Remove(preparePath(deletePath)); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return errFileNotFound
|
||||
} else if os.IsPermission(err) {
|
||||
return errFileAccessDenied
|
||||
}
|
||||
return err
|
||||
}
|
||||
// Recursively go down the next path and delete again.
|
||||
|
||||
Reference in New Issue
Block a user