diff --git a/internal/core/subsume/subsume.go b/internal/core/subsume/subsume.go index 82f522457b2..dc8ffcd8607 100644 --- a/internal/core/subsume/subsume.go +++ b/internal/core/subsume/subsume.go @@ -138,7 +138,7 @@ func (s *subsumer) getError() (err errors.Error) { } err = s.errs if s.inexact { - err = internal.DecorateError(internal.ErrInexact, err) + err = errors.Wrap(err, internal.ErrInexact) } return err } diff --git a/internal/internal.go b/internal/internal.go index 60011807c2a..6a53ff6ddbc 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -430,19 +430,3 @@ func GenPath(root string) string { } var ErrInexact = errors.New("inexact subsumption") - -func DecorateError(info error, err errors.Error) errors.Error { - return &decorated{cueError: err, info: info} -} - -type cueError = errors.Error - -type decorated struct { - cueError - - info error -} - -func (e *decorated) Is(err error) bool { - return errors.Is(e.info, err) || errors.Is(e.cueError, err) -}