errors

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadWaitState = errors.New("encountered bad state while waiting for resource")

RetryableErrors are the errors which will cause the operation to be retried

Functions

func NewWithStatusCode

func NewWithStatusCode(err error, response *http.Response) error

NewWithStatusCode wraps err in an Error that provides better error messages than the openapi.GenericOpenAPIError, and can be retried if the HTTP response StatusCode is in RetryableErrors. If err is nil, NewWithStatusCode() returns nil.

Types

type BadWaitState added in v0.22.4

type BadWaitState struct {
	State string
}

func NewBadWaitStateError added in v0.22.4

func NewBadWaitStateError(state string) BadWaitState

func (BadWaitState) Error added in v0.22.4

func (e BadWaitState) Error() string

func (BadWaitState) Unwrap added in v0.22.4

func (e BadWaitState) Unwrap() error

type Error

type Error struct {
	// ErrorModel is the ErrorModel of the underlying error
	*openapi.ErrorModel
	// Cause is the underlying cause of the error
	Cause error
	// StatusCode is the HTTP status code from the REST API call.
	StatusCode int
}

Error is an error returned by the Rockset REST API.

func New

func New(err error) Error

New wraps err in an Error that provides better error messages than the openapi.GenericOpenAPIError

func (Error) Error

func (e Error) Error() string

Error returns a string representation of the error

func (Error) IsNotFoundError

func (e Error) IsNotFoundError() bool

IsNotFoundError returns true when the error is from an underlying 404 response from the Rockset REST API.

func (Error) RateLimited

func (e Error) RateLimited() bool

RateLimited checks if the error came from a http.StatusTooManyRequests, which is used for rate limiting.

func (Error) Retryable

func (e Error) Retryable() bool

Retryable returns true if the error is in RetryableErrors

func (Error) Unwrap

func (e Error) Unwrap() error

Unwrap returns the cause of the Error

Jump to

Keyboard shortcuts

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