errutil

package
v1.9.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL