errors.go

v0.2.0
Doc Versions Source
1
package culpa
2
3
import "errors"
4
5
// Is reports whether any error in err's tree matches target.
6
// It is a convenience re-export of [errors.Is].
7
func Is(err, target error) bool { return errors.Is(err, target) }
8
9
// As finds the first error in err's tree that matches target and sets
10
// target to that error value. It is a convenience re-export of [errors.As].
11
func As(err error, target any) bool { return errors.As(err, target) }
12
13
// AsType finds the first error in err's tree that matches type E.
14
// It is a convenience re-export of [errors.AsType].
15
func AsType[E error](err error) (E, bool) { return errors.AsType[E](err) }
16
17
// Unwrap returns the result of calling the Unwrap method on err, if
18
// err's type implements Unwrap. It is a convenience re-export of [errors.Unwrap].
19
func Unwrap(err error) error { return errors.Unwrap(err) }
20

Source Files