Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PanicToError ¶
func PanicToError(rec interface{}) error
PanicToError takes an arbitrary object returned from recover(), and returns an appropriate error.
If the input is nil, then nil is returned.
If the input is an error returned from a previus call to PanicToError(), then it is returned verbatim.
If the input is an error, it is wrapped with the message "PANIC:" and has a stack trace attached to it.
If the input is anything else, it is formatted with "%+v" and returned as an error with a stack trace attached.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.