Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PanicHandlers = []func(interface{}){logPanic}
PanicHandlers is a list of functions which will be invoked when a panic happens.
Functions ¶
func GetCallStackTrace ¶ added in v0.0.60
func GetCallStackTrace() string
func GetCallerWithSkip ¶
GetCaller returns the caller of the function that calls it. The argument skip is the number of stack frames to skip before recording in pc, with 0 identifying the frame for Callers itself and 1 identifying the caller of Callers
func GetShortCaller ¶
func GetShortCaller() string
func Recover ¶ added in v0.0.60
func Recover()
must use defer Recover() not effective for calling defer func() {Recover()}()
func RecoverFromPanic ¶ added in v0.0.60
func RecoverFromPanic(err *error)
RecoverFromPanic replaces the specified error with an error containing the original error, and the call tree when a panic occurs. This enables error handlers to handle errors and panics the same way.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.