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
What's a more elegant way to handle errors? #90
Comments
This is going to be a problem moving forwards with Python (specifically). PEP 404 does allow for these "post release" versions which are not compliant with semantic versioning. The quick fix for this issue is to use "Unknown" for the versioning scheme which in turn allows to try semantic versioning first, and then fallback to fuzzy-match. The longer (more correct) fix involves writing a Python versioning scheme parser that follows PEP 404 closely. Namely: |
This specific error is being handled in #91 , this issue should encompass how we want to deal with displaying errors and go error handling in general. Lets consider this a spike for now. |
This is fixed with #124 and https://github.com/anchore/grype-db-builder/pull/53 |
Reopening — this is a spike for investigation of error reporting patterns across the application(s) |
Spike ConclusionsConsulted referencesError handling in Go by Uday Hiwarale Emergent philosophies
Suggested next steps
|
Discussed in a Zoom meeting with Alex and Alfredo, and there was general agreement on these opinions and next steps. 👍 |
There's a scenario where grype will show an error to the user, related to an issue parsing a package version, and then will exit 0, despite the apparent error.
This display of an error is jarring and confusing to users. We should talk through what the definition of the "correct way to handle this scenario" is.
In general, I'd suggest we not show errors and then exit cleanly. And for this specific
Malformed version
error, we should answer a few relevant questions:WARN
instead of anERROR
?Error text:
The text was updated successfully, but these errors were encountered: