errors

package
v0.0.0-...-9bc73c2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

As finds the first error in errors chain that matches target, and if so, sets target to that error value and returns true. Otherwise, it returns false.

func Is

func Is(err, target error) bool

Is reports whether any error in errors chain matches target.

func New

func New(text string) error

New is equivalent to errors.New().

func Verbose

func Verbose(err error) string

Verbose prints the most verbose error that the error message has.

Types

type CallErr

type CallErr struct {
	Req *http.Request
	// Resp contains response body
	Resp *http.Response
	Err  error
}

CallErr represents an HTTP call error. Has a Verbose() method that allows getting the http.Request and Response objects. Implements error.

func (CallErr) Error

func (e CallErr) Error() string

Errors implements error.Error().

func (CallErr) Verbose

func (e CallErr) Verbose() string

Verbose prints a versbose error message with the request or response.

Jump to

Keyboard shortcuts

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