Categorygithub.com/hexbee-net/errors
modulepackage
0.0.0-20201013151528-f2d483efa2c2
Repository: https://github.com/hexbee-net/errors.git
Documentation: pkg.go.dev

# README

errors

Errors package compatible with https://github.com/pkg/errors with some sprinkles.

Actions Status GoDoc Report card

Adding context to an error

Adding fields to an error

Retrieve fields associated with an error

Retrieving the cause of an error

Unpack wrapped errors

# Functions

Cause returns the underlying cause of the error, if possible.
Errorf formats according to a format specifier and returns the string as a value that satisfies error.
GetFields retrieve all the fields associated with an error stack.
New returns an error with the supplied message.
Unpack returns a slice of all the underlying errors, if possible.
WithField annotates err with the specified field.
WithFields annotates err with fields.
WithMessage annotates err with a new message.
WithMessagef annotates err with the format specifier.
WithStack annotates err with a stack trace at the point WithStack was called.
Wrap returns an error annotating err with a stack trace at the point Wrap is called, and the supplied message.
Wrapf returns an error annotating err with a stack trace at the point Wrapf is called, and the format specifier.

# Type aliases

Error is used to be able to declare const errors.
Fields is used to manipulate error fields.