Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
func Call(f func(), panicCallback ...PanicCallback)
Call safely executes the provided function f and recovers from any panic, invoking the registered panic callbacks with the error and stack trace.
func CallCallBack ¶
func CallCallBack(callbacks ...PanicCallback)
CallCallBack appends the zutils callbacks for safe.Call, it should be used only in the main package.
func Callback ¶
func Callback(callbacks ...PanicCallback)
Callback appends the provided callbacks to both safe.Go and safe.Call.
func Go ¶
func Go(f func(), panicCallback ...PanicCallback)
Go safely executes the provided function f in a new goroutine and recovers from any panic, invoking the registered panic callbacks with the error and stack trace. NOTE: don't use it in the function never return!!!!!
func GoCallBack ¶
func GoCallBack(callbacks ...PanicCallback)
GoCallBack appends the zutils callbacks for safe.Go, it should be used only in the main package.
Types ¶
type PanicCallback ¶
PanicCallback defines a function type that takes an error and a stack trace as parameters.