Version: v1.5.0 Latest Latest

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 18




This section is empty.


View Source
var (
	// ErrNotFound is returned when something is not found, this might be used for direct comparison
	ErrNotFound = xhttp.NewError(xerrors.NewInvalidParamsError(errors.New("not found")), http.StatusNotFound)
	// ErrHeaderNotFound is returned when a header is not found
	ErrHeaderNotFound = xerrors.NewInvalidParamsError(errors.New("header not found"))
	// ErrBatchQuery is returned when a batch query is found
	ErrBatchQuery = xerrors.NewInvalidParamsError(errors.New("batch queries are currently not supported"))
	// ErrNoQueryFound is returned when a target is not found
	ErrNoQueryFound = xerrors.NewInvalidParamsError(errors.New("no query found"))
	// ErrInvalidResultParamError is returned when result field for complete tag request
	// is an unexpected value
	ErrInvalidResultParamError = xerrors.NewInvalidParamsError(errors.New("invalid 'result' type for complete tag request"))
	// ErrNoName is returned when no name param is provided in the resource path
	ErrNoName = xerrors.NewInvalidParamsError(errors.New("invalid path with no name present"))
	// ErrInvalidMatchers is returned when invalid matchers are provided
	ErrInvalidMatchers = xerrors.NewInvalidParamsError(errors.New("invalid matchers"))
	// ErrNamesOnly is returned when label values results are name only
	ErrNamesOnly = xerrors.NewInvalidParamsError(errors.New("can not render label values; result has label names only"))
	// ErrWithNames is returned when label values results are name only
	ErrWithNames = xerrors.NewInvalidParamsError(errors.New("can not render label list; result has label names and values"))
	// ErrMultipleResults is returned when there are multiple label values results
	ErrMultipleResults = xerrors.NewInvalidParamsError(errors.New("can not render label values; multiple results detected"))
View Source
var (
	// ErrNilWriteQuery is returned when trying to write a nil query.
	ErrNilWriteQuery = errors.New("nil write query")

	// ErrRemoteWriteQuery is returned when trying to write to a remote
	// endpoint query.
	ErrRemoteWriteQuery = errors.New("cannot write to remote endpoint")

	// ErrNotImplemented is returned when the storage endpoint is not implemented.
	ErrNotImplemented = errors.New("not implemented")

	// ErrInvalidFetchResponse is returned when fetch fails from storage.
	ErrInvalidFetchResponse = errors.New("invalid response from fetch")

	// ErrFetchResponseOrder is returned fetch responses are not in order.
	ErrFetchResponseOrder = errors.New("responses out of order for fetch")

	// ErrFetchRequestType is an error returned when response from fetch has
	// an invalid type.
	ErrFetchRequestType = errors.New("invalid request type")

	// ErrNoValidResults is an error returned when there are no stores
	// that succeeded the fanout.
	ErrNoValidResults = errors.New("no valid results in fanout")

	// ErrInvalidFetchResult is an error returned when fetch result is invalid.
	ErrInvalidFetchResult = errors.New("invalid fetch result")

	// ErrZeroInterval is an error returned when fetch interval is 0.
	ErrZeroInterval = errors.New("interval cannot be 0")

	// ErrInvalidOperation is an error returned when fetch raw is called on wrong
	// storage type.
	ErrInvalidOperation = errors.New("can only fetch raw iterators on" +
		" local storage")

	// ErrBadRequestType is an error returned when a request type is unexpected.
	ErrBadRequestType = errors.New("request is an invalid type")

	// ErrCannotDecodeCompressedTags is an error returned when compressed
	// tags cannot be decoded.
	ErrCannotDecodeCompressedTags = errors.New("unable to decode compressed tags")

	// ErrCannotDecodeDecompressedTags is an error returned when decompressed
	// tags cannot be decoded.
	ErrCannotDecodeDecompressedTags = errors.New("unable to decode" +
		" decompressed tags")

	// ErrCannotEncodeCompressedTags is an error returned when compressed tags
	// cannot be encoded.
	ErrCannotEncodeCompressedTags = errors.New("unable to encode compressed tags")

	// ErrOnlyFixedResSupported is an error returned we try to get step size
	// for variable resolution.
	ErrOnlyFixedResSupported = errors.New("only fixed resolution supported")

	// ErrUnexpectedGRPCResponseType is an error returned when rpc response type
	// is unhandled.
	ErrUnexpectedGRPCResponseType = errors.New("unexpected grpc response type")

	// ErrInconsistentCompleteTagsType is an error returned when a complete tags
	// request returns an inconsistenent type.
	ErrInconsistentCompleteTagsType = errors.New("inconsistent complete tags" +
		" response type")
View Source
var (
	// ErrNoClientAddresses is an error when there are no addresses passed to the remote client
	ErrNoClientAddresses = errors.New("no client addresses given")


func ErrMaxConcurrentQueriesLimitExceeded

func ErrMaxConcurrentQueriesLimitExceeded(n, limit int) error

ErrMaxConcurrentQueriesLimitExceeded is an error when the query cannot be run because the maximum number of queries has been reached.

func IsTimeout added in v1.2.0

func IsTimeout(err error) bool

IsTimeout returns true if the error was caused by a timeout.


type ErrQueryTimeout added in v1.2.0

type ErrQueryTimeout struct {
	// contains filtered or unexported fields

ErrQueryTimeout is returned when a query times out executing.

func NewErrQueryTimeout added in v1.2.0

func NewErrQueryTimeout(err error) *ErrQueryTimeout

NewErrQueryTimeout wraps the provided causing error as an ErrQueryTimeout.

func (*ErrQueryTimeout) Code added in v1.2.0

func (e *ErrQueryTimeout) Code() int

Code returns an HTTP 504.

func (*ErrQueryTimeout) Error added in v1.2.0

func (e *ErrQueryTimeout) Error() string

Error returns the error string of the causing error.

func (*ErrQueryTimeout) InnerError added in v1.2.0

func (e *ErrQueryTimeout) InnerError() error

InnerError returns the cause of the query timeout.

Jump to

Keyboard shortcuts

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