diff options
Diffstat (limited to 'pkg/commands/errors.go')
-rw-r--r-- | pkg/commands/errors.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/commands/errors.go b/pkg/commands/errors.go new file mode 100644 index 000000000..4723eb95d --- /dev/null +++ b/pkg/commands/errors.go @@ -0,0 +1,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) +} |