diff --git a/command/meta_new.go b/command/meta_new.go index a1d376b34..9447caf3b 100644 --- a/command/meta_new.go +++ b/command/meta_new.go @@ -47,7 +47,7 @@ func (m *Meta) Module(path string) (*module.Tree, error) { err = mod.Load(m.moduleStorage(m.DataDir()), module.GetModeNone) if err != nil { - return nil, fmt.Errorf("Error loading modules: %s", err) + return nil, errwrap.Wrapf("Error loading modules: {{err}}", err) } return mod, nil diff --git a/config/import_tree.go b/config/import_tree.go index 3c0912dd9..08cbc7736 100644 --- a/config/import_tree.go +++ b/config/import_tree.go @@ -5,6 +5,8 @@ import ( "fmt" "io" "os" + + "github.com/hashicorp/errwrap" ) // configurable is an interface that must be implemented by any configuration @@ -125,10 +127,7 @@ func (t *importTree) Close() error { func (t *importTree) ConfigTree() (*configTree, error) { config, err := t.Raw.Config() if err != nil { - return nil, fmt.Errorf( - "Error loading %s: %s", - t.Path, - err) + return nil, errwrap.Wrapf(fmt.Sprintf("Error loading %s: {{err}}", t.Path), err) } // Build our result