errors

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 3 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")
	// ErrNoSchema occurs when a schema definition cannot be found for a given
	// set of filter criteria.
	ErrNoSchema = errors.New("no such schema")
	// 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")
	// ErrUnsupportedCluster occurs when a cluster parameter is invalid.
	ErrUnsupportedCluster = errors.New("unsupported cluster(s)")
)

Functions

This section is empty.

Types

type BadRequest added in v0.10.0

type BadRequest struct {
	Err        error
	ErrDetails interface{}
}

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() interface{}

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() interface{}

func (*ErrInvalidCluster) Error

func (e *ErrInvalidCluster) Error() string

func (*ErrInvalidCluster) HTTPStatus

func (e *ErrInvalidCluster) 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() interface{}

func (*MissingParams) Error

func (e *MissingParams) Error() string

func (*MissingParams) HTTPStatus

func (e *MissingParams) HTTPStatus() int

type TypedError

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

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

type Unknown

type Unknown struct {
	Err        error
	ErrDetails interface{}
}

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() interface{}

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