Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrErrpNil = errors.New("errp cannot be nil")
ErrErrpNil indicates that a function with an error pointer argument received an errp nil value.
if errors.Is(err, ErrErrpNil) …
Functions ¶
func Annotation ¶
func Annotation() (annotation string)
Annotation provides a default annotation [base package].[function]: "mypackage.MyFunc"
func Log ¶
func Log(format string, a ...interface{})
Log invocations always print and output to stderr. if debug is enabled, code location is appended.
func NoOnError ¶
func NoOnError(err error)
NoOnError is used with Recover to silence the default error logging
func Recover ¶
Recover recovers from a panic invoking a function no more than once. If there is *errp does not hold an error and there is no panic, onError is not invoked. Otherwise, onError is invoked exactly once. *errp is updated with a possible panic.
func RecoverInvocationPanic ¶
func RecoverInvocationPanic(fn func(), errp *error)
RecoverInvocationPanic is intended to wrap callback invocations in the callee in order to recover from panics in the callback function. when an error occurs, perrors.AppendError appends the callback error to *errp. if fn is nil, a recovered panic results. if errp is nil, a panic is thrown, can be check with:
if errors.Is(err, ErrErrpNil) …
Types ¶
This section is empty.