Documentation ¶
Index ¶
- Variables
- func Cause(err error) error
- func Is(err, target error) bool
- func New(msg string) error
- func NewCause(msg string) error
- func NewWithCause(cause error, msg string) error
- func NewWithCausef(cause error, format string, a ...any) error
- func Newf(format string, a ...any) error
- func WithStack(err error)
- type Base
- type Custom
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyCause = NewCause("")
EmptyCause for matching errors created without a cause
Functions ¶
func NewWithCause ¶
NewWithCause creates a new error with cause and msg
func NewWithCausef ¶
NewType creates a new error with cause and formatted msg
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base does not implement causer. It's the base for custom errors defined with this package
type Custom ¶
type Custom struct {
// contains filtered or unexported fields
}
Custom type for defining errors
func (Custom) Cause ¶
Cause can be used to determine the cause of errors. Useful for grouping related errors, e.g. custom errors defined in the same package
Click to show internal directories.
Click to hide internal directories.