Documentation
¶
Overview ¶
Package errors provides error management.
By convention, wrapping functions return a nil error if the given error is nil.
Index ¶
- Variables
- func As(err error, target any) bool
- func Is(err, target error) bool
- func Join(errs ...error) error
- func New(msg string) error
- func Newf(format string, args ...any) error
- func Unwrap(err error) error
- func Wrap(err error, msg string) error
- func Wrapf(err error, format string, args ...any) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = std_errors.ErrUnsupported
ErrUnsupported is an alias for std_errors.ErrUnsupported.
Functions ¶
func Join ¶ added in v0.3.0
Join calls std_errors.Join and adds a stack.
func New ¶
New returns a new error with a message and a stack.
Warning: don't use this function to create a "sentinel" error, because it contains the stack of the (main) goroutine creating it. Use errbase.New instead.
Example ¶
err := New("error")
fmt.Println(err)
Output: error
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package errbase provides a simple error type.
|
Package errbase provides a simple error type. |
|
Package errignore provides a way to mark errors as ignored.
|
Package errignore provides a way to mark errors as ignored. |
|
Package erriter provides a way to iterate over errors tree.
|
Package erriter provides a way to iterate over errors tree. |
|
Package errmsg provides a way to add messages to errors.
|
Package errmsg provides a way to add messages to errors. |
|
Package errstack provides utilities to manage error stack traces.
|
Package errstack provides utilities to manage error stack traces. |
|
Package errtag provides a way to add tags to errors.
|
Package errtag provides a way to add tags to errors. |
|
Package errtmp provides a way to mark errors as temporary.
|
Package errtmp provides a way to mark errors as temporary. |
|
Package errval provides a way to add values to errors.
|
Package errval provides a way to add values to errors. |
|
Package errverbose provides utilities to manage error verbose messages.
|
Package errverbose provides utilities to manage error verbose messages. |
Click to show internal directories.
Click to hide internal directories.