Documentation ¶
Overview ¶
Package errors implements some utility functions for giving detailed errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause recurses down the given error, if it is Error, to find the underlying Err that triggered it.
func Err ¶
Err wraps the given error in the context in which it occurred. If the given err is nil then nil is returned.
func Is ¶ added in v1.1.0
Is reports whether any error in err's chain matches target. This calls errors.Is from the stdlib.
func MultiError ¶
MultiError returns a concatenation of the given errors.
Types ¶
type Error ¶
type Error struct { Err error // Err is the underlying error that occured. Func string // Func is the name of the calling function that triggered the error. File string // File is the source file where the error occured. Line int // Line is the line number in the source file where the error occurred. }
Error implements the builtin error interface. This captures information about the underlying error itself, and where the error occurred.
Click to show internal directories.
Click to hide internal directories.