fix(go-vulndb): skip error, if broken several modules (#184)
This commit is contained in:
parent
32b738cf73
commit
3c40c660fd
@ -2,13 +2,14 @@ package govulndb
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"golang.org/x/xerrors"
|
||||
"log"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
"strings"
|
||||
|
||||
"github.com/aquasecurity/vuln-list-update/utils"
|
||||
)
|
||||
@ -17,6 +18,7 @@ const (
|
||||
vulndbURL = "https://storage.googleapis.com/go-vulndb"
|
||||
vulndbDir = "go"
|
||||
retry = 3
|
||||
notFoundError = "HTTP error. status code: 404"
|
||||
)
|
||||
|
||||
type options struct {
|
||||
@ -123,6 +125,10 @@ func (c VulnDB) parseModuleEntries(baseURL *url.URL, moduleName string) ([]Entry
|
||||
|
||||
res, err := utils.FetchURL(pkgURL.String(), "", c.retry)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), notFoundError) {
|
||||
log.Println(fmt.Sprintf("module %s not found", moduleName))
|
||||
return nil, nil
|
||||
}
|
||||
return nil, xerrors.Errorf("unable to query %s advisory: %w", moduleName, err)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user