|
|
|
@ -121,12 +121,15 @@ func errorsCause(errs []error) []error { |
|
|
|
|
return cerrs |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var baseIgnoredErrs = []error{ |
|
|
|
|
// Collection of basic errors.
|
|
|
|
|
var baseErrs = []error{ |
|
|
|
|
errDiskNotFound, |
|
|
|
|
errFaultyDisk, |
|
|
|
|
errFaultyRemoteDisk, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var baseIgnoredErrs = baseErrs |
|
|
|
|
|
|
|
|
|
// isErrIgnored returns whether given error is ignored or not.
|
|
|
|
|
func isErrIgnored(err error, ignoredErrs ...error) bool { |
|
|
|
|
err = errorCause(err) |
|
|
|
@ -137,3 +140,14 @@ func isErrIgnored(err error, ignoredErrs ...error) bool { |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// isErr returns whether given error is exact error.
|
|
|
|
|
func isErr(err error, errs ...error) bool { |
|
|
|
|
err = errorCause(err) |
|
|
|
|
for _, exactErr := range errs { |
|
|
|
|
if err == exactErr { |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|