Documentation ¶
Overview ¶
Package errors implements functions to manipulate errors.
Errors created are taggable and wrappable.
errWithTags := errors.New("an error with tags"). Tag("a", 42). Tag("b", 21) errWithWrap := errors.New("error"). Tag("a", 42). Wrap(errors.New("wrapped error"))
The package mirrors https://golang.org/pkg/errors package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func As ¶
As is documented at https://golang.org/pkg/errors/#As.
func Tag ¶
Tag retrieves the value of the tag named by the key. If the tag exists, its value (which may be empty) is returned and the boolean is true. Otherwise the returned value will be empty and the boolean will be false.
func Unwrap ¶
Unwrap is documented at https://golang.org/pkg/errors/#Unwrap.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an error implementation that supports tagging and wrapping.
func (Error) Lookup ¶
Lookup retrieves the value of the tag named by the key. If the tag exists, its value (which may be empty) is returned and the boolean is true. Otherwise the returned value will be empty and the boolean will be false.