// IsNeverConnectedError returns true if err is of type NeverConnectedError.
322696
func IsNeverConnectedError(err error) bool {
	_, ok := errors.Cause(err).(NeverConnectedError)
	return ok
}
753308
func (b *blockServerRemoteClientHandler) OnConnectError(err error, wait time.Duration) {
	b.log.Warning("%s: connection error: %v; retrying in %s", b.name, err, wait)
	if b.authToken != nil {
		b.authToken.Shutdown()
	}
	b.pinger.cancelTicker()
	// TODO: it might make sense to show something to the user if this is
	// due to authentication, for example.
}
629791
func isConnErr(err error) bool {
	if err == nil {
		return false
	}
	if err.Error() == "no Elasticsearch node available" {
		return true
	}
	innerErr := errors.Cause(err)
	if innerErr == nil {
		return false
	}
	if innerErr.Error() == "no Elasticsearch node available" {
		return true
	}
	return false
}
1007377
func IsConnectionReset(err error) bool {
	if urlErr, ok := err.(*url.Error); ok {
		err = urlErr.Err
	}
	if opErr, ok := err.(*net.OpError); ok {
		err = opErr.Err
	}
	if osErr, ok := err.(*os.SyscallError); ok {
		err = osErr.Err
	}
	if errno, ok := err.(syscall.Errno); ok && errno == syscall.ECONNRESET {
		return true
	}
	return false
}
1031304
func IsCorruptionError(err error) bool {
	switch err {
	case io.ErrUnexpectedEOF, zip.ErrFormat, zip.ErrChecksum, zip.ErrAlgorithm, ErrHashMismatch:
		return true
	}
	return false
}
1318889
func IsNoResultsError(err error) bool {
	switch errType := errors.Cause(err).(type) {
	case NoResultsError:
		return errType.NoResultsError()
	default:
		return false
	}
}
1257910
func IsNotFoundError(err error) bool {
	switch err.(type) {
	case NetworkNotFoundError:
		return true
	case EndpointNotFoundError:
		return true
	case NamespaceNotFoundError:
		return true
	case LoadBalancerNotFoundError:
		return true
	}
	return false
}
159731
func IsNotFoundError(err error) bool {
	es := err.Error()
	for _, str := range iptablesNotFoundStrings {
		if strings.Contains(es, str) {
			return true
		}
	}
	return false
}
1341382
func IsForbiddenError(err error) (bool, error) {
	e, ok := errs.Cause(err).(ForbiddenError)
	if !ok {
		return false, nil
	}
	return true, e
}
480164
func IsNoAddressError(err error) bool {
	err = errors.Cause(err)
	_, ok := err.(*noAddress)
	return ok
}
7008
func (r *Response) IsError() bool {
	return r != nil && r.Data != nil && len(r.Data) == 1 && r.Data["error"] != nil
}
368940
func (c *Client) IsConnected() bool {
	c.RLock()
	defer c.RUnlock()
	return c.connected
}
912082
func IsUnexpectedError(err error) bool {
	return yarpcerrors.FromError(err).Code() == yarpcerrors.CodeInternal
}
686181
func (c *client) IsConnected() bool {
	c.RLock()
	defer c.RUnlock()
	status := atomic.LoadUint32(&c.status)
	switch {
	case status == connected:
		return true
	case c.options.AutoReconnect && status > connecting:
		return true
	default:
		return false
	}
}
1258624
func RetryableError(err error) *RetryError {
	if err == nil {
		return nil
	}
	return &RetryError{Err: err, Retryable: true}
}
163954
func IsUnexpectedServerError(err error) bool {
	switch t := err.(type) {
	case APIStatus:
		if d := t.Status().Details; d != nil {
			for _, cause := range d.Causes {
				if cause.Type == metav1.CauseTypeUnexpectedServerResponse {
					return true
				}
			}
		}
	}
	return false
}
1332802
func IsHTTPError(err error) bool {
	cause := errors.Cause(err)
	if nErr, ok := cause.(HTTPError); ok {
		return nErr.HTTPError()
	}

	return false
}