From ed0cf86f546108c870bb912f1a0ee30f337b3da0 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Fri, 28 Jul 2023 11:10:36 -0700 Subject: [PATCH] FileCopier.GetMatches() returns an error message that contains missing path now. Signed-off-by: Dmitri Dolguikh --- changelog/v0.1.1/better-error-message.yaml | 5 +++++ pkg/manager/common.go | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/v0.1.1/better-error-message.yaml diff --git a/changelog/v0.1.1/better-error-message.yaml b/changelog/v0.1.1/better-error-message.yaml new file mode 100644 index 0000000..58ffd30 --- /dev/null +++ b/changelog/v0.1.1/better-error-message.yaml @@ -0,0 +1,5 @@ +changelog: + - type: NON_USER_FACING + issueLink: + resolvesIssue: false + description: FileCopier.GetMatches() returns an error message that contains missing path now. diff --git a/pkg/manager/common.go b/pkg/manager/common.go index c43a210..37ba953 100644 --- a/pkg/manager/common.go +++ b/pkg/manager/common.go @@ -16,8 +16,8 @@ import ( ) /* - This interface is used to abstract away the methods which require ENV vars or other - system things. This is mostly for unit testing purposes. +This interface is used to abstract away the methods which require ENV vars or other +system things. This is mostly for unit testing purposes. */ type FileCopier interface { Copy(src, dst string) (int64, error) @@ -37,7 +37,7 @@ func (c *copier) GetMatches(copyPat []string, dir string) ([]string, error) { for _, pat := range copyPat { matches, err := zglob.Glob(filepath.Join(dir, pat)) if err != nil { - return nil, eris.Wrapf(err, "Error! glob match failure") + return nil, eris.Wrapf(err, "Error! glob match failure for path: %s", filepath.Join(dir, pat)) } // Filter out all matches which contain a vendor folder, those are leftovers from a previous run. // Might be worth clearing the vendor folder before every run.