mirror of
https://github.com/minio/minio.git
synced 2025-11-29 21:33:31 -05:00
xl/fs: isFunctions should only return boolean. (#1525)
log the unrecognize errors.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
937d68202d
commit
a56d5ef415
@@ -139,6 +139,9 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64) (io.Read
|
||||
if !IsValidBucketName(bucket) {
|
||||
return nil, BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return nil, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
// Verify if object is valid.
|
||||
if !IsValidObjectName(object) {
|
||||
return nil, ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
@@ -201,16 +204,14 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
if !IsValidBucketName(bucket) {
|
||||
return ObjectInfo{}, BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
// Check whether the bucket exists.
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return ObjectInfo{}, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
// Verify if object is valid.
|
||||
if !IsValidObjectName(object) {
|
||||
return ObjectInfo{}, ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
}
|
||||
// Check whether the bucket exists.
|
||||
if isExist, err := isBucketExist(xl.storage, bucket); err != nil {
|
||||
return ObjectInfo{}, err
|
||||
} else if !isExist {
|
||||
return ObjectInfo{}, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
fi, err := xl.storage.StatFile(bucket, object)
|
||||
if err != nil {
|
||||
if err != errFileNotFound {
|
||||
@@ -265,6 +266,9 @@ func (xl xlObjects) DeleteObject(bucket, object string) error {
|
||||
if !IsValidBucketName(bucket) {
|
||||
return BucketNameInvalid{Bucket: bucket}
|
||||
}
|
||||
if !isBucketExist(xl.storage, bucket) {
|
||||
return BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
if !IsValidObjectName(object) {
|
||||
return ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user