From 6cdc6cf90e44a244d994f5118518a8a1e6580064 Mon Sep 17 00:00:00 2001 From: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com> Date: Fri, 26 Feb 2021 20:55:54 +0000 Subject: [PATCH] fix(tool/imports): add path info to error message (#518) --- pkg/jsonnet/imports.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/jsonnet/imports.go b/pkg/jsonnet/imports.go index 2cadcca23..9d11cc2ae 100644 --- a/pkg/jsonnet/imports.go +++ b/pkg/jsonnet/imports.go @@ -1,6 +1,7 @@ package jsonnet import ( + "fmt" "io/ioutil" "path/filepath" "sort" @@ -92,7 +93,7 @@ func importRecursive(list map[string]bool, vm *jsonnet.VM, node ast.Node, curren contents, foundAt, err := vm.ImportAST(currentPath, p) if err != nil { - return errors.Wrap(err, "importing jsonnet") + return fmt.Errorf("importing '%s' from '%s': %w", p, currentPath, err) } abs, _ := filepath.Abs(foundAt)