rich_error

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target any) bool

func Is

func Is(err, target error) bool

Types

type Error

type Error struct {
	Kind       fmt.Stringer
	Code       fmt.Stringer
	Message    string
	Meta       []slog.Attr
	Stacktrace []uintptr
	Previous   error
}

func New

func New(kind, code fmt.Stringer, message string, attrs ...slog.Attr) *Error

func Wrap

func Wrap(err error, kind, code fmt.Stringer, message string, attrs ...slog.Attr) *Error

func WrapMeta

func WrapMeta(err error, attrs ...slog.Attr) *Error

func WrapMetaWithStack

func WrapMetaWithStack(err error, attrs ...slog.Attr) *Error

func WrapWithStack

func WrapWithStack(err error, kind, code fmt.Stringer, message string, attrs ...slog.Attr) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) LogAttrs

func (e *Error) LogAttrs() []slog.Attr

func (*Error) Stack

func (e *Error) Stack() []uintptr

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL