Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WrapErr ¶
WrapErr wraps an underlying error with another error
Example usage:
var ErrLimit = errors.New("Limit reached")
...
func someFunc() error {
return wrapper.WrapErr{Err: fmt.Errorf("Limit %d reached on %s", limit, instance), Wrap: ErrLimit}
}
...
if errors.Is(err, ErrLimit) { ... }
This makes it easier to include a custom error message while also allowing
Click to show internal directories.
Click to hide internal directories.