errors

package
v0.0.0-...-18a76ad Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectOK

func ExpectOK(res *http.Response, msg string) error

ExpectOK checks if the given http response has status "200 - OK" and returns an error with the given message if not.

func ExpectStatus

func ExpectStatus(res *http.Response, expected int, msg string) error

ExpectStatus checks if the given http response has the expected status and returns an error with the given message if not.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if the given error is a "not found" error.

func NewNotFound

func NewNotFound(s string, v ...interface{}) error

NewNotFound creates a new "not found" error.

func NewValidationError

func NewValidationError(msg string, v ...interface{}) error

NewValidationError creates an error of from the given format string.

func Wrap

func Wrap(err error, msg string, v ...interface{}) error

Wrap wraps an error by prepending additional text. The text can contain formatting parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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