summaryrefslogtreecommitdiffstats
path: root/pkg/commands/errors.go
blob: 4723eb95d863794c25451cc06d5c29962d5e6cfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package commands

import "github.com/go-errors/errors"

// WrapError wraps an error for the sake of showing a stack trace at the top level
// the go-errors package, for some reason, does not return nil when you try to wrap
// a non-error, so we're just doing it here
func WrapError(err error) error {
	if err == nil {
		return err
	}

	return errors.Wrap(err, 0)
}