errors

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: MIT Imports: 3 Imported by: 6

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 err's chain that matches target, and if so, sets target to that error value and returns true. Otherwise, it returns false. See: https://golang.org/pkg/errors/#As

func Cause

func Cause(err error) error

Cause of the error. This returns the very first error encoutered whether that was a new application error or an external error.

func Is

func Is(err, target error) bool

Is reports whether any error in err's chain matches target. See: https://golang.org/pkg/errors/#Is

func New

func New(internalCode string, format string, values ...interface{}) error

New error. This should be called when the application creates a brand new error. If an error has been received from an external function or is propogating an error, use Wrap().

func Unwrap

func Unwrap(err error) error

Unwrap returns the result of calling the Unwrap method on err, if err's type contains an Unwrap method returning error. Otherwise, Unwrap returns nil. See: https://golang.org/pkg/errors/#Unwrap

func Wrap

func Wrap(internalCode string, err error) error

Wrap an existing error. The internalCode should be a unique code to allow developers to easily identify the source of an issue.

Types

This section is empty.

Jump to

Keyboard shortcuts

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