mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-23 00:38:26 +00:00
6e1436cefb
Signed-off-by: Evan Lezar <elezar@nvidia.com>
20 lines
524 B
Go
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)
|
|
}
|