errors

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The operation looked fine on paper, but something went wrong
	Server Type = "server"
	// The thing you mentioned, whatever it is, just doesn't exist
	Missing = "missing"
	// The operation was well-formed, but you asked for something that
	// can't happen at present (e.g., because you've not supplied some
	// config yet)
	User = "user"
)

Variables

This section is empty.

Functions

func IsMissing

func IsMissing(err error) bool

Types

type Error

type Error struct {
	Type Type
	// a message that can be printed out for the user
	Help string `json:"help"`
	// the underlying error that can be e.g., logged for developers to look at
	Err error
}

Representation of errors in the API. These are divided into a small number of categories, essentially distinguished by whose fault the error is; i.e., is this error:

  • a transient problem with the service, so worth trying again?
  • not going to work until the user takes some other action, e.g., updating config?

func CoverAllError

func CoverAllError(err error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(data []byte) error

type Type

type Type string

Jump to

Keyboard shortcuts

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