Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PanicHandlers = []PanicHandler{logHandler}
View Source
var ReallyCrash = true
Functions ¶
func HandlePanic ¶
func HandlePanic(additionalHandlers ...PanicHandler)
func PropagatePanicAsError ¶
func PropagatePanicAsError(errp *error, callStandardHandlers bool, additionalHandlers ...PanicHandler)
PropagatePanicAsError is intended to be called via defer to map a recovered panic to an error and propagate it to the error return value of the calling function. Use: defer panics.PropagatePanicAsError(&err, false) It incorporates the originally returned error by the surrounding function and all errors provided by the panic handlers plus the mapped recovered panic.
func RegisterPanicHandler ¶
func RegisterPanicHandler(handler PanicHandler)
RegisterPanicHandler adds handlers to the panic handler.
Types ¶
type PanicHandler ¶
type PanicHandler func(interface{}) error
Click to show internal directories.
Click to hide internal directories.