// IsRetriableError indicates the low level transfer had an error but the
// caller may retry the operation.
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
}
829167
func canRetry(args interface{}, err error) bool {
	// No leader errors are always safe to retry since no state could have
	// been changed.
	if structs.IsErrNoLeader(err) {
		return true
	}

	// Reads are safe to retry for stream errors, such as if a server was
	// being shut down.
	info, ok := args.(structs.RPCInfo)
	if ok && info.IsRead() && lib.IsErrEOF(err) {
		return true
	}

	return false
}
71926
func IsError(err error, code ErrorCode) bool {
	e, ok := err.(ManagerError)
	return ok && e.ErrorCode == code
}
903897
func IsError(err error, code int) bool {
	if e, ok := err.(*errorBox); ok {
		return e.code == code
	}
	return false
}
892813
func IsUnprocessableEntityError(err error) bool {
	if e, ok := err.(interface {
		UnprocessableEntityError() bool
	}); ok {
		return e.UnprocessableEntityError()
	}
	if parent := parentOf(err); parent != nil {
		return IsUnprocessableEntityError(parent)
	}
	return false
}
330821
func NewLogarithmicRetryableError(err error, maxAttempts int, baseOffset, scale, power float64) RetryableError {
	return &logarithmicRetryableError{err, maxAttempts, baseOffset, scale, power}
}
434287
func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
	// If one of the other handlers already set the retry state
	// we don't want to override it based on the service's state
	if r.Retryable != nil {
		return *r.Retryable
	}

	if r.HTTPResponse.StatusCode >= 500 && r.HTTPResponse.StatusCode != 501 {
		return true
	}
	return r.IsErrorRetryable() || d.shouldThrottle(r)
}
545028
func IsResetError(e error) bool {
	if _, ok := e.(*ResetError); ok {
		return true
	}
	return false
}
639
func (r *retryCounter) CanRetry(oid string) (int, bool) {
	count := r.CountFor(oid)
	return count, count < r.MaxRetries
}
541172
func IsErrUnknownAllocation(err error) bool {
	return err != nil && strings.Contains(err.Error(), ErrUnknownAllocationPrefix)
}
502242
func IsErrNotImplemented(err error) bool {
	if _, ok := err.(notImplementedError); ok {
		return ok
	}
	return errdefs.IsNotImplemented(err)
}
1278603
func (s AbnormalFinish_Status) CouldRetry() bool {
	switch s {
	case AbnormalFinish_FAILED, AbnormalFinish_CRASHED,
		AbnormalFinish_EXPIRED, AbnormalFinish_TIMED_OUT:

		return true
	}
	return false
}
660710
func IsInteroperabilityError(err error) bool {
	if te, ok := err.(tiffErrors); ok {
		_, isInterop := te[loadInteroperability]
		return isInterop
	}
	return false
}
797141
func IsNeverLoggedInError(err error) bool {
	_, ok := errors.Cause(err).(NeverLoggedInError)
	return ok
}
1158264
func IsRetryableError(err error) bool {
	if err == io.EOF {
		return true
	}
	if _, ok := err.(*FailedToOpenFileError); ok {
		return true
	}

	return false
}
1318889
func IsNoResultsError(err error) bool {
	switch errType := errors.Cause(err).(type) {
	case NoResultsError:
		return errType.NoResultsError()
	default:
		return false
	}
}
360265
func isErrClosing(err error) bool {
	if opErr, ok := err.(*net.OpError); ok {
		err = opErr.Err
	}
	return "use of closed network connection" == err.Error()
}