Documentation
¶
Overview ¶
Package errors provides a multi-error that is aware of the source location it was created.
Index ¶
- Variables
- func Message(template string, params ...any) string
- func New(template string, params ...any) error
- func Panic(template string, params ...any)
- func ToStrings(errors ...error) []string
- func Unwrap(err error) []error
- func Wrap(cause error, template string, params ...any) error
- func WrapAll(causes []error, template string, params ...any) error
- func WrapMessage(cause error, template string, params ...any) string
Constants ¶
This section is empty.
Variables ¶
var ProjectRoot = ``
ProjectRoot is used to trim paths in verbose output. Anything in the path up to, and including ProjectRoot will be removed from the front of the output paths.
var Verbose = false
Verbose is used to control verbose output. When true, error messages will include the caller's location.
Functions ¶
func Panic ¶
Panic panics with a message formatted the way an error returned from this package would be.
func Unwrap ¶
Unwrap takes an error, which can be a single error or a multi-error, and unwraps it into a flat slice of errors.
func Wrap ¶
Wrap returns an error formatted according to the given template and parameters with the given error as its cause.
Types ¶
This section is empty.