error

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIErrIs added in v0.4.0

func APIErrIs(err error, code int, str string) bool

APIErrIs attempts to coerce err into an UnexpectedResponseError to check its status code. Failing that, it will look for str in the error string. If code==0 it will be ignored, same for str==""

func FormattedMultiError

func FormattedMultiError(err *multierror.Error) error

FormattedMultiError wraps any non-nil multierrors with the multiErrorFunc. It is safe to call in cases where the err may or may not be nil and will overwrite the existing formatter.

func MultiErrorFunc

func MultiErrorFunc(err []error) string

MultiErrorFunc is a helper to convert the standard multierror output into something a little more friendly to consoles.

Types

type StatusCoder added in v0.4.0

type StatusCoder interface {
	Error() string
	Unwrap() error
	StatusCode() int
}

StatusCoder is an error with an extra StatusCode method. mainly, nomad api.UnexpectedResponseError implements this.

Jump to

Keyboard shortcuts

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