mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Merge pull request #1046 from harshavardhana/bucket-not-empty
deleteBucket: Directory not empty error on windows is "directory is n…
This commit is contained in:
commit
67a70eb6d6
@ -48,6 +48,12 @@ func (fs Filesystem) DeleteBucket(bucket string) *probe.Error {
|
|||||||
return probe.NewError(e)
|
return probe.NewError(e)
|
||||||
}
|
}
|
||||||
if e := os.Remove(bucketDir); e != nil {
|
if e := os.Remove(bucketDir); e != nil {
|
||||||
|
// On windows the string is slightly different, handle it here.
|
||||||
|
if strings.Contains(e.Error(), "directory is not empty") {
|
||||||
|
return probe.NewError(BucketNotEmpty{Bucket: bucket})
|
||||||
|
}
|
||||||
|
// Hopefully for all other operating systems, this is
|
||||||
|
// assumed to be consistent.
|
||||||
if strings.Contains(e.Error(), "directory not empty") {
|
if strings.Contains(e.Error(), "directory not empty") {
|
||||||
return probe.NewError(BucketNotEmpty{Bucket: bucket})
|
return probe.NewError(BucketNotEmpty{Bucket: bucket})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user