Documentation
¶
Index ¶
- func Callers(depth int) []string
- func Partition(err error, predicate func(err error) bool) (matched error, notMatched error)
- func Summary(err error) string
- func Unwrap(err error, visitor func(err error))
- func WithDetails(err error, d Details) error
- func WithSecondaryError(err, serr error) error
- type DetailTag
- type DetailTaggedValue
- type Detailer
- type Details
- type Stacker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Partition ¶
Partition takes a predicate and an error, and returns a pair of joined errors of which do and do not satisfy the predicate, respectively
Example usage
matched, notMatched := Partition(someJoinedErr, func(err error) bool { return errors.Is(err, errA) }) if errors.Is(matched, errA) { ... }
func WithDetails ¶
func WithSecondaryError ¶
Types ¶
type DetailTag ¶
type DetailTag string
const (
SafeDetail DetailTag = "safe"
)
func (DetailTag) Value ¶
func (t DetailTag) Value(value interface{}) DetailTaggedValue
type DetailTaggedValue ¶
type DetailTaggedValue struct { Tag DetailTag Value interface{} }
func (DetailTaggedValue) MarshalText ¶
func (tv DetailTaggedValue) MarshalText() ([]byte, error)
type Details ¶
type Details map[string]interface{}
func CollectDetails ¶
func FilterDetails ¶
func GetSafeDetails ¶
Click to show internal directories.
Click to hide internal directories.