errors

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package errors contains error definitions for storage providers.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNodeNotFound is returned when a node is not found.
	ErrNodeNotFound = errors.New("node not found")
	// ErrNotStorageNode is returned when a storage operation is attempted on a non-storage node.
	ErrNotStorageNode = fmt.Errorf("not a storage node")
	// ErrStarted is returned when the storage provider is already started.
	ErrStarted = fmt.Errorf("storage provider already started")
	// ErrClosed is returned when the storage provider is closed.
	ErrClosed = fmt.Errorf("storage provider is closed")
	// ErrNotImplemented is returned when a method is not implemented.
	ErrNotImplemented = fmt.Errorf("not implemented")
	// ErrNoLeader is returned when there is no leader.
	ErrNoLeader = fmt.Errorf("no leader")
	// ErrNotLeader is returned when the node is not the leader.
	ErrNotLeader = fmt.Errorf("not leader")
	// ErrNotVoter is returned when the node is not a voter.
	ErrNotVoter = fmt.Errorf("not voter")
	// ErrAlreadyBootstrapped is returned when the storage provider is already bootstrapped.
	ErrAlreadyBootstrapped = fmt.Errorf("already bootstrapped")
	// ErrKeyNotFound is the error returned when a key is not found.
	ErrKeyNotFound = errors.New("key not found")
	// ErrNotFound is an alias to ErrKeyNotFound
	ErrNotFound = ErrKeyNotFound
	// ErrInvalidKey is the error returned when a key is invalid.
	ErrInvalidKey = errors.New("invalid key")
	// ErrInvalidPrefix is the error returned when a prefix is invalid.
	ErrInvalidPrefix = errors.New("invalid prefix")
	// ErrEdgeNotFound is returned when an edge is not found.
	ErrEdgeNotFound = graph.ErrEdgeNotFound
	// ErrRoleNotFound is returned when a role is not found.
	ErrRoleNotFound = fmt.Errorf("role not found")
	// ErrRoleBindingNotFound is returned when a rolebinding is not found.
	ErrRoleBindingNotFound = fmt.Errorf("rolebinding not found")
	// ErrGroupNotFound is returned when a group is not found.
	ErrGroupNotFound = fmt.Errorf("group not found")
	// ErrIsSystemRole is returned when a system role is being modified.
	ErrIsSystemRole = fmt.Errorf("cannot modify system role")
	// ErrIsSystemRoleBinding is returned when a system rolebinding is being modified.
	ErrIsSystemRoleBinding = fmt.Errorf("cannot modify system rolebinding")
	// ErrIsSystemGroup is returned when a system group is being modified.
	ErrIsSystemGroup = fmt.Errorf("cannot modify system group")
	// ErrACLNotFound is returned when a NetworkACL is not found.
	ErrACLNotFound = errors.New("network acl not found")
	// ErrRouteNotFound is returned when a Route is not found.
	ErrRouteNotFound = errors.New("route not found")
	// ErrInvalidACL is returned when a NetworkACL is invalid.
	ErrInvalidACL = errors.New("invalid network acl")
	// ErrInvalidRoute is returned when a Route is invalid.
	ErrInvalidRoute = errors.New("invalid route")
	// ErrEmptyNodeID is returned when a node ID is empty.
	ErrEmptyNodeID = errors.New("node ID must not be empty")
	// ErrInvalidNodeID is returned when a node ID is invalid.
	ErrInvalidNodeID = errors.New("node ID is invalid")
	// ErrInvalidQuery is returned when a query is invalid.
	ErrInvalidQuery = errors.New("invalid query")
)

Common errors for storage providers to use.

View Source
var Is = errors.Is

Is is a shortcut for errors.Is.

Functions

func IsACLNotFound

func IsACLNotFound(err error) bool

IsACLNotFound returns true if the given error is a ErrACLNotFound error.

func IsAlreadyBootstrapped

func IsAlreadyBootstrapped(err error) bool

IsAlreadyBootstrappedError returns true if the given error is a ErrAlreadyBootstrapped error.

func IsEdgeNotFound

func IsEdgeNotFound(err error) bool

IsEdgeNotFound returns true if the given error is a ErrEdgeNotFound error.

func IsGroupNotFound

func IsGroupNotFound(err error) bool

IsGroupNotFoundError returns true if the given error is a ErrGroupNotFound error.

func IsInvalidACL

func IsInvalidACL(err error) bool

IsInvalidACL returns true if the given error is a ErrInvalidACL error.

func IsInvalidRoute

func IsInvalidRoute(err error) bool

IsInvalidRoute returns true if the given error is a ErrInvalidRoute error.

func IsKeyNotFound

func IsKeyNotFound(err error) bool

IsKeyNotFoundError returns true if the given error is a ErrKeyNotFound error.

func IsNoLeader

func IsNoLeader(err error) bool

IsNoLeader returns true if the given error is a ErrNoLeader error.

func IsNodeNotFound

func IsNodeNotFound(err error) bool

IsNodeNotFound returns true if the given error is a ErrNodeNotFound error.

func IsNotFound added in v0.12.0

func IsNotFound(err error) bool

IsNotFound returns if the error matches any of the known not found errors.

func IsRoleBindingNotFound

func IsRoleBindingNotFound(err error) bool

IsRoleBindingNotFound returns true if the given error is a ErrRoleBindingNotFound error.

func IsRoleNotFound

func IsRoleNotFound(err error) bool

IsRoleNotFound returns true if the given error is a ErrRoleNotFound error.

func IsRouteNotFound

func IsRouteNotFound(err error) bool

IsRouteNotFound returns true if the given error is a ErrRouteNotFound error.

func NewKeyNotFoundError

func NewKeyNotFoundError(key []byte) error

NewKeyNotFoundError returns a new ErrKeyNotFound error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL