nvidia-container-toolkit/vendor/github.com/tsaikd/KDGoLib/errutil/trace.go
Evan Lezar 6e1436cefb Update go vendoring
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2021-09-07 13:13:03 +02:00

20 lines
524 B
Go

package errutil
// Trace error stack, output to default ErrorFormatter, panic if output error
func Trace(errin error) {
TraceSkip(errin, 1)
}
// TraceWrap trace errin and wrap with wraperr only if errin != nil
func TraceWrap(errin error, wraperr error) {
if errin != nil {
errs := NewErrorsSkip(1, wraperr, errin)
TraceSkip(errs, 1)
}
}
// TraceSkip error stack, output to default ErrorFormatter, skip n function calls, panic if output error
func TraceSkip(errin error, skip int) {
Logger().TraceSkip(errin, 1)
}