Documentation
¶
Overview ¶
Package errors implements functions to manipulate errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NonFatal ¶
type NonFatal struct{ E error }
NonFatal contains non-fatal errors, which are errors that permit execution to continue, but should return with a non-nil error. As such, NonFatal is a data structure useful for swallowing non-fatal errors, but being able to reproduce them at the end of the function. An error is non-fatal if it is collection of non-fatal errors, or is an individual error where IsRequiredNotSet or IsInvalidUTF8 reports true.
Typical usage pattern:
var nerr errors.NonFatal ... if err := MyFunction(); !nerr.Merge(err) { return nil, err // immediately return if err is fatal } ... return out, nerr.E
func (*NonFatal) AppendInvalidUTF8 ¶
AppendInvalidUTF8 appends an InvalidUTF8 error.
func (*NonFatal) AppendRequiredNotSet ¶
AppendRequiredNotSet appends a RequiredNotSet error.
type NonFatalErrors ¶
type NonFatalErrors []error
NonFatalErrors is a list of non-fatal errors where each error must either be a RequiredNotSet error or InvalidUTF8 error. The list must not be empty.
func (NonFatalErrors) Error ¶
func (es NonFatalErrors) Error() string