Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func As ¶
As finds the first error in err's tree that matches target, and if one is found, sets target to that error value and returns true. Otherwise, it returns false.
This calls errors.As under the hood, and is intended to allow this package to serve as a drop-in replacement for errors.
func Is ¶
Is reports whether any error in err's tree matches target.
This calls errors.Is under the hood, and is intended to allow this package to serve as a drop-in replacement for errors.
func Join ¶
Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if every value in errs is nil.
This calls errors.Join under the hood, and is intended to allow this package to serve as a drop-in replacement for errors.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is an error type with embedded stack trace and optional logging attributes.
func (*Error) Error ¶
Error conforms to the stdlib error interface, allowing you to return this as an error value.`
func (*Error) Fields ¶
Fields returns a []any of any fields added to the error using Error.With with each key prefixed with `err_` to set them apart from other logged attributes.
type Location ¶
Location represents a single frame in the call stack.
func (*Location) Format ¶
Format implements fmt.Formatter, allowing a Location to be printed using the following print verbs:
- %s, %v gives `<file>:<line>`
- %q gives `"<file>:<line>"`
- %+v gives `<file>:<line>(<function>)`
- %#v gives `errors.Location{File: "<file>", Function: "<function>", Line: <line>}`