Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(redhat-oval): return an error if the CPE is not found #428

Conversation

DmitriyLewen
Copy link
Collaborator

Description

Get() function returns an error if the CPE is not found

@@ -248,6 +248,10 @@ func (vs VulnSrc) Get(pkgName string, repositories, nvrs []string) ([]types.Advi
return nil, xerrors.Errorf("CPE convert error: %w", err)
}

if len(cpeIndices) == 0 {
return nil, xerrors.Errorf("No CPE indices found")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, xerrors.Errorf("No CPE indices found")
return nil, xerrors.Errorf("no CPE indices found")

Copy link
Collaborator

@knqyf263 knqyf263 Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this error message is unclear. What do you think about adding this issue to the error message?
#435

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It make sense.
Updated in 83716e8

@knqyf263 knqyf263 merged commit 54beb6c into aquasecurity:main Sep 2, 2024
2 checks passed
@DmitriyLewen DmitriyLewen deleted the refactor-redhat/err-when-cpe-not-found branch September 5, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants