errors

package
v0.19.6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAmbiguousSchema occurs when more than one schema is found for a given
	// set of filter criteria.
	ErrAmbiguousSchema = errors.New("multiple schemas found")
	// ErrAmbiguousTablet occurs when more than one tablet is found for a given
	// set of filter criteria.
	ErrAmbiguousTablet = errors.New("multiple tablets found")
	// ErrAmbiguousWorkflow occurs when more than one workflow is found for a
	// set of filter criteria that should ordinarily never return more than one
	// workflow.
	ErrAmbiguousWorkflow = errors.New("multiple workflows found")
	// ErrInvalidRequest occurs when a request is invalid for any reason.
	// For example, if mandatory parameters are undefined.
	ErrInvalidRequest = errors.New("Invalid request")
	// ErrNoServingTablet occurs when a tablet with state SERVING cannot be
	// found for a given set of filter criteria. It is a more specific form of
	// ErrNoTablet
	ErrNoServingTablet = fmt.Errorf("%w with state=SERVING", ErrNoTablet)
	// ErrNoSrvVSchema occurs when no SrvVSchema is found for a given keyspace.
	ErrNoSrvVSchema = errors.New("SrvVSchema not found")
	// ErrNoTablet occurs when a tablet cannot be found for a given set of
	// filter criteria.
	ErrNoTablet = errors.New("no such tablet")
	// ErrNoWorkflow occurs when a workflow cannot be found for a given set of
	// filter criteria.
	ErrNoWorkflow = errors.New("no such workflow")
	// ErrUnauthorized occurs when attempting to perform a (subject, resource, action)
	// in a cluster that the rbac configuration does not allow.
	ErrUnauthorized = errors.New("unauthorized")
	// ErrUnsupportedCluster occurs when a cluster parameter is invalid.
	ErrUnsupportedCluster = errors.New("unsupported cluster(s)")
)

Errors returned by API endpoints.

View Source
var (
	// ErrNoFlag occurs when cluster config parsing encounters a flag specified
	// in the DSN that is not defined.
	ErrNoFlag = errors.New("flag provided but not defined")
)

Errors returned by cluster setup and flag parsing.

Functions

This section is empty.

Types

type BadRequest added in v0.10.0

type BadRequest struct {
	Err        error
	ErrDetails any
}

BadRequest is returned when some request parameter is invalid.

func (*BadRequest) Code added in v0.10.0

func (e *BadRequest) Code() string

func (*BadRequest) Details added in v0.10.0

func (e *BadRequest) Details() any

func (*BadRequest) Error added in v0.10.0

func (e *BadRequest) Error() string

func (*BadRequest) HTTPStatus added in v0.10.0

func (e *BadRequest) HTTPStatus() int

type ErrInvalidCluster

type ErrInvalidCluster struct {
	Err error
}

ErrInvalidCluster is returned when a cluster parameter, either in a route or as a query param, is invalid.

func (*ErrInvalidCluster) Code

func (e *ErrInvalidCluster) Code() string

func (*ErrInvalidCluster) Details

func (e *ErrInvalidCluster) Details() any

func (*ErrInvalidCluster) Error

func (e *ErrInvalidCluster) Error() string

func (*ErrInvalidCluster) HTTPStatus

func (e *ErrInvalidCluster) HTTPStatus() int

type Internal added in v0.14.0

type Internal struct {
	Err        error
	ErrDetails any
}

Internal is returned when an http adapter encounters an internal error (e.g. an internal route variable name changed).

Functionally, this is the same as Unknown with a different error code.

func (*Internal) Code added in v0.14.0

func (e *Internal) Code() string

func (*Internal) Details added in v0.14.0

func (e *Internal) Details() any

func (*Internal) Error added in v0.14.0

func (e *Internal) Error() string

func (*Internal) HTTPStatus added in v0.14.0

func (e *Internal) HTTPStatus() int

type MissingParams

type MissingParams struct {
	Params []string
}

MissingParams is returned when an HTTP handler requires parameters that were not provided.

func (*MissingParams) Code

func (e *MissingParams) Code() string

func (*MissingParams) Details

func (e *MissingParams) Details() any

func (*MissingParams) Error

func (e *MissingParams) Error() string

func (*MissingParams) HTTPStatus

func (e *MissingParams) HTTPStatus() int

type NoSuchSchema added in v0.11.0

type NoSuchSchema struct {
	Clusters []string
	Table    string
}

NoSuchSchema is returned when a schema definition cannot be found for a given set of filter criteria. Both GetSchema and FindSchema can return this error.

func (*NoSuchSchema) Code added in v0.11.0

func (e *NoSuchSchema) Code() string

func (*NoSuchSchema) Details added in v0.11.0

func (e *NoSuchSchema) Details() any

func (*NoSuchSchema) Error added in v0.11.0

func (e *NoSuchSchema) Error() string

func (*NoSuchSchema) HTTPStatus added in v0.11.0

func (e *NoSuchSchema) HTTPStatus() int

type TypedError

type TypedError interface {
	Error() string
	Code() string
	Details() any
	HTTPStatus() int
}

TypedError defines the behavior needed to strongly-type an error into an http response.

type Unknown

type Unknown struct {
	Err        error
	ErrDetails any
}

Unknown is the generic error, used when a more specific error is either unspecified or inappropriate.

func (*Unknown) Code

func (e *Unknown) Code() string

func (*Unknown) Details

func (e *Unknown) Details() any

func (*Unknown) Error

func (e *Unknown) Error() string

func (*Unknown) HTTPStatus

func (e *Unknown) HTTPStatus() int

Jump to

Keyboard shortcuts

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