errors

package
v0.0.0-...-a6b604f Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExternal = New("external")

ErrExternal is a special kind of error. It not only represents itself, but also any other error that does not implement causer interface. This is usually true for errors that are comming from outside of this package.

Functions

This section is empty.

Types

type Error

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

func New

func New(description string) *Error

New is created for the compability with the standard library. It should be used to create an error of a new kind. It most cases it is better to use Wrap function or New Method of an existing error.

func Wrap

func Wrap(err error, format string, args ...interface{}) *Error

Wrap returns an error that inherits from the given one.

func WrapErr

func WrapErr(err error, other error) *Error

func (*Error) Cause

func (e *Error) Cause() error

Cause returns the cause of this error or nil if this is the root cause error.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (kind *Error) Is(err error) bool

Is returns true if given error is of a given kind. This is a shortcut method for Is function.

Jump to

Keyboard shortcuts

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