From b5427cfbaa5b8b6a2cf078dbe838e493e9539567 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 12 Jan 2021 11:23:40 -0800 Subject: [PATCH] compiler: properly format cue errors Signed-off-by: Andrea Luzzardi --- dagger/compiler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dagger/compiler.go b/dagger/compiler.go index 0abc300e..237cbe3f 100644 --- a/dagger/compiler.go +++ b/dagger/compiler.go @@ -8,6 +8,7 @@ import ( "sync" "cuelang.org/go/cue" + cueerrors "cuelang.org/go/cue/errors" cueload "cuelang.org/go/cue/load" "github.com/pkg/errors" ) @@ -103,7 +104,7 @@ func (cc *Compiler) Build(ctx context.Context, fs FS, args ...string) (*Value, e } inst, err := cc.Cue().Build(instances[0]) if err != nil { - return nil, err + return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{})) } return cc.Wrap(inst.Value(), inst), nil }