Skip to content

Commit

Permalink
fix: enhance error-handling
Browse files Browse the repository at this point in the history
ref #523

Signed-off-by: Christian Kotzbauer <[email protected]>
  • Loading branch information
ckotzbauer committed Aug 13, 2024
1 parent 8f48ebe commit c4714c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/vuln/grype/grype.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ func (s *Grype) ScanItem(item source.ScanItem) (vuln.ScanResult, error) {
IgnoreRules: s.config.Ignore,
}

remainingMatches, _, _ := runner.FindMatches(packages, pkg.Context{Distro: context.Distro})
remainingMatches, _, err := runner.FindMatches(packages, pkg.Context{Distro: context.Distro})
if err != nil {
logrus.WithError(err).Error("Failed to find matches")
return vuln.ScanResult{}, err
}

vulns := s.buildVulnerabilities(*remainingMatches, item.ImageId())
return s.filterVulnerabilities(vulns), nil
}
Expand Down

0 comments on commit c4714c3

Please sign in to comment.