errors

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when an aggregate is not known to the system.
	ErrNotFound = errors.New("aggregate not found")
	// ErrDeleted is returned when an aggregate has been deleted.
	ErrDeleted = errors.New("aggregate is deleted")
	// ErrUnknownAggregateType is returned returned when an unknown or invalid aggregate type is used.
	ErrUnknownAggregateType = errors.New("aggregate type unknown")

	// ErrUnauthorized is returned when a requested command can not be executed because the current user is unauthorized.
	ErrUnauthorized = errors.New("unauthorized")
	// ErrUnauthenticated is returned when a the current user is unauthenticated.
	ErrUnauthenticated = errors.New("unauthenticated")
	// ErrUserNotFound is returned when a user is not known to the system.
	ErrUserNotFound = errors.New("user not found")
	// ErrUserAlreadyExists is returned when a user does already exist.
	ErrUserAlreadyExists = errors.New("user already exists")

	// ErrUserRoleBindingAlreadyExists is returned when a userrolebinding does already exist.
	ErrUserRoleBindingAlreadyExists = errors.New("userrolebinding already exists")
	// ErrUserRoleBindingNotFound is returned when a binding by that name or id cannot be found.
	ErrUserRoleBindingNotFound = errors.New("userrolebinding not found")

	// ErrTenantNotFound is returned when a tenant is not known to the system.
	ErrTenantNotFound = errors.New("tenant not found")
	// ErrTenantAlreadyExists is returned when a tenant does already exist.
	ErrTenantAlreadyExists = errors.New("tenant already exists")

	// ErrClusterRegistrationNotFound is returned when a cluster registration is not known to the system.
	ErrClusterRegistrationNotFound = errors.New("cluster registration not found")
	// ErrClusterRegistrationAlreadyExists is returned when an aggregate does already exist.
	ErrClusterRegistrationAlreadyExists = errors.New("cluster registration already exists")

	// ErrClusterNotFound is returned when a cluster is not known to the system.
	ErrClusterNotFound = errors.New("cluster not found")
	// ErrClusterAlreadyExists is returned when a cluster does already exist.
	ErrClusterAlreadyExists = errors.New("cluster already exists")

	// ErrCertificateAlreadyExists is returned when a cert does already exist.
	ErrCertificateAlreadyExists = errors.New("certificate already exists")

	// ErrTenantClusterBindingAlreadyExists is returned when a tenant-cluster-binding does already exist.
	ErrTenantClusterBindingAlreadyExists = errors.New("tenant already has access to that cluster")
	// ErrTenantClusterBindingNotFound is returned when a tenant-cluster-binding could not be found.
	ErrTenantClusterBindingNotFound = errors.New("no cluster access found for the given cluster and tenant")
)

Functions

func ErrFailedPrecondition

func ErrFailedPrecondition(msg string) error

Returns a gRPC status error with FailedPrecondition code

func ErrInvalidArgument

func ErrInvalidArgument(msg string) error

Returns a gRPC status error with InvalidArgument code

func TranslateFromGrpcError

func TranslateFromGrpcError(err error) error

TranslateFromGrpcError takes an error that could be an error received via gRPC and converts it to a specific domain error to make it easily comparable.

func TranslateToGrpcError

func TranslateToGrpcError(err error) error

TranslateToGrpcError converts an error to a gRPC status error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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