Documentation
¶
Index ¶
- func AllAnnotated(err error) iter.Seq[AnnotatedError]
- func As(err error, target any) bool
- func DecoratePanic(excp any) error
- func Is(err, target error) bool
- func Join(errs ...error) error
- func NewSentinel(msg string) error
- func SlogError(err error) slog.Attr
- func Unwrap(err error) error
- func Wrap(err error, msg string, attrs ...slog.Attr) error
- type AnnotatedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllAnnotated ¶
func AllAnnotated(err error) iter.Seq[AnnotatedError]
AllAnnotated returns an iterator that iterates over all the AnnotatedError in err.
func DecoratePanic ¶
DecoratePanic returns an annotated error with the stack trace of the panic.
func NewSentinel ¶
NewSentinel creates a plain error without other context that can be used as sentinel error that can be detected with errors.Is.
Types ¶
type AnnotatedError ¶
type AnnotatedError struct {
// contains filtered or unexported fields
}
AnnotatedError includes more context than a plain error that is useful for troubleshooting.
func New ¶
func New(msg string, attrs ...slog.Attr) AnnotatedError
New creates a new AnnotatedError with the given message and attributes.
func (AnnotatedError) Error ¶
func (err AnnotatedError) Error() string
Error implements error interface.
Click to show internal directories.
Click to hide internal directories.