// IsNotFoundError returns true if the cause of the given error can be
// converted to an NotFoundError, which is returned as the second result.
963420
func IsNotFoundError(err error) (bool, error) {
	e, ok := errs.Cause(err).(NotFoundError)
	if !ok {
		return false, nil
	}
	return true, e
}
225325
func IsNotImplementedError(err error) bool {
	if e, ok := err.(interface {
		NotImplemented() bool
	}); ok {
		return e.NotImplemented()
	}
	if parent := parentOf(err); parent != nil {
		return IsNotImplementedError(parent)
	}
	return false
}
525612
func (cp *ComparablePrincipal) IsFound(set ...*ComparablePrincipal) bool {
	for _, cp2 := range set {
		if cp.IsA(cp2) {
			return true
		}
	}
	return false
}
11368
func ErrorIsNotFound(err error) bool {
	_, ok := errors.Cause(err).(*ErrNotFound)
	return ok
}
450268
func IsNoLeaderOrOngoing(err error) bool {
	return IsArangoErrorWithCode(err, 503) && (IsArangoErrorWithErrorNum(err, 1495) || IsArangoErrorWithErrorNum(err, 1496))
}
912082
func IsUnexpectedError(err error) bool {
	return yarpcerrors.FromError(err).Code() == yarpcerrors.CodeInternal
}
188762
func IsError(err error, code int) bool {
	perr, ok := err.(*Err)
	return ok && perr.c == code
}
974070
func NotFound(message string, args ...interface{}) error {
	return WrapWithMessage(&NotFoundError{
		Message: fmt.Sprintf(message, args...),
	}, message, args...)
}
1016202
func NewNotFoundErrorWithKey(entity string, key, value string) NotFoundError {
	return NotFoundError{entity: entity, key: key, value: value}
}
816715
func IsErrUnknownEvaluation(err error) bool {
	return err != nil && strings.Contains(err.Error(), ErrUnknownEvaluationPrefix)
}
974815
func IsContextNotFound(err error) bool {
	if err == nil {
		return false
	}
	if _, ok := err.(*errContextNotFound); ok || err == ErrNoContext {
		return true
	}
	return strings.Contains(err.Error(), "context was not found for specified context")
}
604627
func IsInternalError(err error) (bool, error) {
	e, ok := errs.Cause(err).(InternalError)
	if !ok {
		return false, nil
	}
	return true, e
}
1188145
func (k *Kubernetes) IsNameError(err error) bool {
	return err == errNoItems || err == errNsNotExposed || err == errInvalidRequest
}
747882
func IsCmdNotFoundErr(err error) bool {
	err = errors.Cause(err)
	if os.IsNotExist(err) {
		// Executable could not be found, go 1.3 and later
		return true
	}
	if err == exec.ErrNotFound {
		return true
	}
	if execErr, ok := err.(*exec.Error); ok {
		// Executable could not be found, go 1.2
		if os.IsNotExist(execErr.Err) || execErr.Err == exec.ErrNotFound {
			return true
		}
	}
	return false
}
113622
func IsNotFound(err error) bool {
	switch err := err.(type) {
	case *Error:
		return err.Code == NotFoundErr
	}
	return false
}
634343
func IsNotFound(err error) bool {
	nf, ok := err.(notFoundError)
	return ok && nf.IsNotFound()
}
1056996
func IsFortressError(err error) bool {
	switch errors.Cause(err) {
	case ErrAborted, ErrShutdown:
		return true
	default:
		return false
	}
}