Documentation
¶
Overview ¶
Package errutil combines primitives from the library, the Go errors package and github.com/pkg/errors. It aims to serve as drop-in replacement to gitub.com/pkg/errors and replace the legacy implementation of `pgerrors`.
Index ¶
- func AssertionFailedWithDepthf(depth int, format string, args ...interface{}) error
- func AssertionFailedf(format string, args ...interface{}) error
- func New(msg string) error
- func NewAssertionErrorWithWrappedErrDepthf(depth int, origErr error, format string, args ...interface{}) error
- func NewAssertionErrorWithWrappedErrf(origErr error, format string, args ...interface{}) error
- func NewWithDepth(depth int, msg string) error
- func NewWithDepthf(depth int, format string, args ...interface{}) error
- func Newf(format string, args ...interface{}) error
- func WithMessage(err error, msg string) error
- func WithMessagef(err error, format string, args ...interface{}) error
- func Wrap(err error, msg string) error
- func WrapWithDepth(depth int, err error, msg string) error
- func WrapWithDepthf(depth int, err error, format string, args ...interface{}) error
- func Wrapf(err error, format string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertionFailedWithDepthf ¶
AssertionFailedWithDepthf creates an internal error with a stack trace collected at the specified depth.
func AssertionFailedf ¶
AssertionFailedf creates an internal error.
func NewAssertionErrorWithWrappedErrDepthf ¶
func NewAssertionErrorWithWrappedErrDepthf( depth int, origErr error, format string, args ...interface{}, ) error
NewAssertionErrorWithWrappedErrDepthf is like NewAssertionErrorWithWrappedErrf but the depth at which the call stack is captured can be specified.
func NewAssertionErrorWithWrappedErrf ¶
NewAssertionErrorWithWrappedErrf wraps an error and turns it into an assertion error. Both details from the original error and the context of the caller are preserved. The original error is not visible as cause any more. The original error message is preserved.
func NewWithDepth ¶
NewWithDepth is like New() except the depth to capture the stack trace is configurable.
func NewWithDepthf ¶
NewWithDepthf is like Newf() except the depth to capture the stack trace is configurable.
func WithMessage ¶
WithMessage wraps an error with a simple error message prefix.
func WithMessagef ¶
WithMessagef wraps an error with a simple error message prefix.
func WrapWithDepth ¶
WrapWithDepth is like Wrap except the depth to capture the stack trace is configurable.
func WrapWithDepthf ¶
WrapWithDepthf is like Wrapf except the depth to capture the stack trace is configurable.
Types ¶
This section is empty.