fix(db): fix javadb downloading error handling (#7642)

Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
Nikita Pivkin
2024-10-03 18:11:58 +06:00
committed by GitHub
parent cb0b3a9279
commit 2c87f0cb79

View File

@@ -104,10 +104,10 @@ func (u *Updater) downloadDB(ctx context.Context) error {
Quiet: u.quiet, Quiet: u.quiet,
} }
if err := artifacts.Download(ctx, u.dbDir, downloadOpt); err != nil { 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 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) { func Init(cacheDir string, javaDBRepositories []name.Reference, skip, quiet bool, registryOption ftypes.RegistryOptions) {