Documentation
¶
Index ¶
- Variables
- func CodeOf[T comparable](err error, opts ...func(*CodeOption[T])) T
- func Empty[T comparable](code T) func(*CodeOption[T])
- func Errorf(format string, a ...any) error
- func Get[T comparable](err error, key string) (any, bool)
- func In[T comparable](err error, codes ...T) bool
- func Join(errs ...error) error
- func NaN[T comparable](code T) func(*CodeOption[T])
- func New(text string) error
- func Wrap(err error) error
- type Builder
- type CodeOption
- type Error
- func (ex Error[T]) Code() T
- func (ex *Error[T]) Error() string
- func (ex *Error[T]) Get(key string) (any, bool)
- func (ex *Error[T]) In(codes ...T) bool
- func (ex *Error[T]) Is(err error) bool
- func (ex *Error[T]) Items() iter.Seq2[string, any]
- func (ex *Error[T]) LogValue() slog.Value
- func (ex *Error[T]) MarshalJSON() ([]byte, error)
- func (ex Error[T]) Stacktrace() Stack
- func (ex *Error[T]) String() string
- func (ex *Error[T]) Unwrap() error
- type Stack
Constants ¶
This section is empty.
Variables ¶
View Source
var Length = 1024
View Source
var Stacktrace = func() Stack { return nil }
View Source
var Unspecified = struct{}{}
Functions ¶
func CodeOf ¶ added in v1.0.6
func CodeOf[T comparable](err error, opts ...func(*CodeOption[T])) T
func Empty ¶ added in v1.0.4
func Empty[T comparable](code T) func(*CodeOption[T])
func In ¶ added in v1.0.4
func In[T comparable](err error, codes ...T) bool
func NaN ¶ added in v1.0.4
func NaN[T comparable](code T) func(*CodeOption[T])
Types ¶
type Builder ¶ added in v1.0.4
type Builder[T comparable] Error[T]
func Code ¶ added in v1.0.4
func Code[T comparable](code T) Builder[T]
type CodeOption ¶ added in v1.0.7
type CodeOption[T comparable] struct { Empty T NaN T }
type Error ¶ added in v1.0.4
type Error[T comparable] struct { // contains filtered or unexported fields }
func Be ¶ added in v1.0.4
func Be[T comparable](err error) *Error[T]
func (*Error[T]) MarshalJSON ¶ added in v1.0.4
func (Error[T]) Stacktrace ¶ added in v1.0.4
Click to show internal directories.
Click to hide internal directories.