Documentation ¶
Overview ¶
Package errp wraps the github.com/pkg/errors package, because its name clashes with the builtin errors package, which confuses the automatic imports tool goimports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // New wraps errors.New New = errors.New // Newf wraps errors.Newf Newf = errors.Errorf // WithStack wraps errors.WithStack WithStack = errors.WithStack // Cause wraps errors.Cause Cause = errors.Cause // Wrap wraps errors.Wrap Wrap = errors.Wrap // WithMessage wraps errors.WithMessage WithMessage = errors.WithMessage )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context map[string]interface{}
Context provides the context for a detailed error.
type DetailedError ¶
DetailedError combines an error with a map of data points that provide more context and are useful for logging.
func WithContext ¶
func WithContext(err error, data Context) *DetailedError
WithContext takes an error and a data map and provides a DetailedError that combines both.
func (DetailedError) Error ¶
func (detailedError DetailedError) Error() string
Click to show internal directories.
Click to hide internal directories.