From 72e827d8d4a79b7a6ac03b49253b2ccdf334190d Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Thu, 3 Oct 2024 16:58:38 +0600 Subject: [PATCH 1/2] fix(db): fix javadb downloading error handling Signed-off-by: nikpivkin --- pkg/javadb/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/javadb/client.go b/pkg/javadb/client.go index 6d5b589bb5d1..75186bceb6f6 100644 --- a/pkg/javadb/client.go +++ b/pkg/javadb/client.go @@ -107,7 +107,7 @@ func (u *Updater) downloadDB(ctx context.Context) error { return xerrors.Errorf("failed to download vulnerability DB: %w", err) } - return xerrors.New("failed to download Java DB from any source") + return nil } func Init(cacheDir string, javaDBRepositories []name.Reference, skip, quiet bool, registryOption ftypes.RegistryOptions) { From 3575c1819e5d3d82d197582c1514e379bfc4303d Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Thu, 3 Oct 2024 17:26:05 +0600 Subject: [PATCH 2/2] chore: update error msg Signed-off-by: nikpivkin --- pkg/javadb/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/javadb/client.go b/pkg/javadb/client.go index 75186bceb6f6..835730109b02 100644 --- a/pkg/javadb/client.go +++ b/pkg/javadb/client.go @@ -104,7 +104,7 @@ func (u *Updater) downloadDB(ctx context.Context) error { Quiet: u.quiet, } if err := artifacts.Download(ctx, u.dbDir, downloadOpt); err != nil { - return xerrors.Errorf("failed to download vulnerability DB: %w", err) + return xerrors.Errorf("failed to download Java DB: %w", err) } return nil