// IsResetError returns a boolean indicating whether the error is a result of
// a problem resetting the file buffer.
545028
func IsResetError(e error) bool {
	if _, ok := e.(*ResetError); ok {
		return true
	}
	return false
}
47900
func IsRetryError(e error) bool {
	type ad interface {
		IsRetryError() bool
	}
	_, ok := Unwrap(e).(ad)
	return ok
}
131987
func retryOnError(err error) bool {
	switch err := err.(type) {
	case *os.PathError:
		return retryOnError(err.Err) // unpack the target error
	case syscall.Errno:
		if err == unix.EPERM {
			// EPERM represents an entropy pool exhaustion, a condition under
			// which we backoff and retry.
			return true
		}
	}

	return false
}
962472
func IsRetriableError(err error) bool {
	if e, ok := err.(interface {
		RetriableError() bool
	}); ok {
		return e.RetriableError()
	}
	if cause, ok := Cause(err).(*url.Error); ok {
		return cause.Temporary() || cause.Timeout()
	}
	if parent := parentOf(err); parent != nil {
		return IsRetriableError(parent)
	}
	return false
}
412473
func IsErr(err error, errs ...error) bool {
	for _, exactErr := range errs {
		if err == exactErr {
			return true
		}
	}
	return false
}
559724
func IsCleanPointerError(err error) bool {
	if e, ok := err.(interface {
		CleanPointerError() bool
	}); ok {
		return e.CleanPointerError()
	}
	if parent := parentOf(err); parent != nil {
		return IsCleanPointerError(parent)
	}
	return false
}
474564
func IsStorageAttachedError(err error) bool {
	_, ok := errors.Cause(err).(storageAttachedError)
	return ok
}
1121889
func IsErrNoData(err error) bool {
	if err_, ok := err.(cmn.Error); ok {
		_, ok := err_.Data().(errNoData)
		return ok
	}
	return false
}
1080247
func IsPermanentError(err error) bool {
	if err == nil {
		return false
	}
	if perr, ok := err.(PermanentError); ok {
		return perr.IsPermanent()
	}
	if cerr := errors.Cause(err); cerr != err {
		return IsPermanentError(cerr)
	}
	return false
}
763311
func IsNoSpaceOnDeviceError(err error) bool {
	if err == nil {
		return false
	}
	switch err := err.(type) {
	case NoSpaceOnDeviceError:
		return true
	case *os.PathError:
		return err.Err == syscall.ENOSPC
	case *os.LinkError:
		return err.Err == syscall.ENOSPC
	case *os.SyscallError:
		return err.Err == syscall.ENOSPC
	}

	return false
}
1043686
func IsTokenRefreshError(err error) bool {
	if _, ok := err.(adal.TokenRefreshError); ok {
		return true
	}
	if de, ok := err.(DetailedError); ok {
		return IsTokenRefreshError(de.Original)
	}
	return false
}
63523
func (l *intLogger) IsError() bool {
	return Level(atomic.LoadInt32(l.level)) <= Error
}
1258624
func RetryableError(err error) *RetryError {
	if err == nil {
		return nil
	}
	return &RetryError{Err: err, Retryable: true}
}
732778
func IsErrorRetryable(err error) bool {
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			return isCodeRetryable(aerr.Code()) || isNestedErrorRetryable(aerr)
		}
	}
	return false
}
1177965
func IsRecordNotFoundError(err error) bool {
	if errs, ok := err.(Errors); ok {
		for _, err := range errs {
			if err == ErrRecordNotFound {
				return true
			}
		}
	}
	return err == ErrRecordNotFound
}
322908
func IsRetryableNetworkError(err error) bool {
	if err == nil {
		return false
	}
	// get original error if it was wrapped
	err = argoerrs.Cause(err)
	errStr := err.Error()

	switch err.(type) {
	case net.Error:
		switch err.(type) {
		case *net.DNSError, *net.OpError, net.UnknownNetworkError:
			return true
		case *url.Error:
			// For a URL error, where it replies back "connection closed"
			// retry again.
			if strings.Contains(errStr, "Connection closed by foreign host") {
				return true
			}
		default:
			if strings.Contains(errStr, "net/http: TLS handshake timeout") {
				// If error is - tlsHandshakeTimeoutError, retry.
				return true
			} else if strings.Contains(errStr, "i/o timeout") {
				// If error is - tcp timeoutError, retry.
				return true
			} else if strings.Contains(errStr, "connection timed out") {
				// If err is a net.Dial timeout, retry.
				return true
			}
		}
	}
	return false
}
487279
func IsError(e interface{}, codes ...errorCode) bool {
	err, ok := e.(*routerError)
	if !ok {
		return false
	}

	for _, code := range codes {
		if err.code == code {
			return true
		}
	}

	return false
}