errors

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package errors provides errors reported to the user. These are mapped to a proto.Error by the API and sent to the user. All errors must implement the error interface and return a helpful error message. The message can be terse because it will be reported in context. For example, the RequestNotFound error message makes sense in response to "spinc status abc123" when "abc123" does not exist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbError

type DbError struct {
	// contains filtered or unexported fields
}

Error represents a generic database error. This struct is not superfluous, it allows the API to distinguish the error type and return an appropriate proto.Error.

func NewDbError

func NewDbError(err error, query string) DbError

func (DbError) Error

func (e DbError) Error() string

type ErrInvalidCreateRequest

type ErrInvalidCreateRequest struct {
	Message string
}

func (ErrInvalidCreateRequest) Error

func (e ErrInvalidCreateRequest) Error() string

type ErrInvalidState

type ErrInvalidState struct {
	// contains filtered or unexported fields
}

func NewErrInvalidState

func NewErrInvalidState(expectedState, actualState string) ErrInvalidState

func (ErrInvalidState) Error

func (e ErrInvalidState) Error() string

type JobNotFound

type JobNotFound struct {
	RequestId string
	JobId     string
}

func (JobNotFound) Error

func (e JobNotFound) Error() string

type RequestNotFound

type RequestNotFound struct {
	RequestId string
}

func (RequestNotFound) Error

func (e RequestNotFound) Error() string

type ValidationError

type ValidationError struct {
	Message string
}

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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