mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Add proper custom errors object creations (#7387)
In scenario 1 ``` - bucket/object-prefix - bucket/object-prefix/object ``` Server responds with `XMinioParentIsObject` In scenario 2 ``` - bucket/object-prefix/object - bucket/object-prefix ``` Server responds with `XMinioObjectExistsAsDirectory` Fixes #6566
This commit is contained in:
committed by
kannappanr
parent
12b79d9f3b
commit
c184038b6a
@@ -142,6 +142,10 @@ func renameAll(srcFilePath, dstFilePath string) (err error) {
|
||||
return fmt.Errorf("%s (%s)->(%s)", errCrossDeviceLink, srcFilePath, dstFilePath)
|
||||
case os.IsNotExist(err):
|
||||
return errFileNotFound
|
||||
case os.IsExist(err):
|
||||
// This is returned only when destination is a directory and we
|
||||
// are attempting a rename from file to directory.
|
||||
return errIsNotRegular
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user