errx

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlreadyExistsf

func AlreadyExistsf(format string, args ...interface{}) error

AlreadyExistsf returns an error which satisfies IsAlreadyExists().

func Annotatef

func Annotatef(other error, format string, args ...interface{}) error

func AssertError

func AssertError(tb testing.TB, expected, actual error)

AssertError is an assert helper to check for an expected error.

func BadRequestf

func BadRequestf(format string, args ...interface{}) error

BadRequestf returns an error which satisfies IsBadRequest().

func Cause

func Cause(err error) error

Cause returns the cause of the provided error.

func Equal

func Equal(a, b error) bool

func ErrorStack

func ErrorStack(err error) string

func Errorf

func Errorf(format string, args ...interface{}) error

func Forbiddenf

func Forbiddenf(format string, args ...interface{}) error

Forbiddenf returns an error which satisfies IsForbidden().

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists reports whether the error was created with AlreadyExistsf().

func IsBadRequest

func IsBadRequest(err error) bool

IsBadRequest reports whether err was created with BadRequestf().

func IsErr

func IsErr(err error) bool

func IsForbidden

func IsForbidden(err error) bool

IsForbidden reports whether the error was created with Forbiddenf().

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err was created with NotFoundf().

func IsNotImplemented

func IsNotImplemented(err error) bool

IsNotImplemented reports whether err was created with NotImplementedf().

func IsTimeout

func IsTimeout(err error) bool

IsTimeout reports whether err was created with Timeoutf().

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized reports whether err was created with Unauthorizedf().

func NotFoundf

func NotFoundf(format string, args ...interface{}) error

NotFoundf returns an error which satisfies IsNotFound().

func NotImplementedf

func NotImplementedf(format string, args ...interface{}) error

NotImplementedf returns an error which satisfies IsNotImplemented().

func RequireError

func RequireError(tb testing.TB, expected, actual error)

RequireError is a require helper to check for an expected error.

func Timeoutf

func Timeoutf(format string, args ...interface{}) error

Timeoutf returns an error which satisfies IsTimeout().

func Unauthorizedf

func Unauthorizedf(format string, args ...interface{}) error

Unauthorizedf returns an error which satisfies IsUnauthorized().

func WriteHTTPStatus

func WriteHTTPStatus(w http.ResponseWriter, err error)

WriteHTTPStatus writes the provided error to the provided response writer.

Types

type Err

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

Err defines the extended error struct.

func NewErr

func NewErr(format string, args ...interface{}) Err

func NewErrWithCause

func NewErrWithCause(other error, format string, args ...interface{}) Err

func (*Err) Cause

func (e *Err) Cause() error

func (*Err) Error

func (e *Err) Error() string

func (*Err) Format

func (e *Err) Format(s fmt.State, verb rune)

func (*Err) Location

func (e *Err) Location() (filename string, line int)

func (*Err) Message

func (e *Err) Message() string

func (*Err) SetLocation

func (e *Err) SetLocation(callDepth int)

func (*Err) Underlying

func (e *Err) Underlying() error

Jump to

Keyboard shortcuts

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