Use isErrIgnored() function wherever applicable. (#3343)

This commit is contained in:
Bala FA
2016-11-23 20:05:04 -08:00
committed by Harshavardhana
parent 4ef2d8940c
commit 0f2e493c9a
14 changed files with 49 additions and 84 deletions

View File

@@ -21,17 +21,12 @@ import (
"sync"
)
// list all errors that can be ignore in a bucket operation.
var bucketOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied)
// list all errors that can be ignored in a bucket metadata operation.
var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound)
// list all errors that can be ignore in a bucket operation.
var bucketOpIgnoredErrs = []error{
errFaultyDisk,
errFaultyRemoteDisk,
errDiskNotFound,
errDiskAccessDenied,
}
/// Bucket operations
// MakeBucket - make a bucket.
@@ -143,7 +138,7 @@ func (xl xlObjects) getBucketInfo(bucketName string) (bucketInfo BucketInfo, err
}
err = traceError(err)
// For any reason disk went offline continue and pick the next one.
if isErrIgnored(err, bucketMetadataOpIgnoredErrs) {
if isErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue
}
break
@@ -219,7 +214,7 @@ func (xl xlObjects) listBuckets() (bucketsInfo []BucketInfo, err error) {
return bucketsInfo, nil
}
// Ignore any disks not found.
if isErrIgnored(err, bucketMetadataOpIgnoredErrs) {
if isErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue
}
break