-
Notifications
You must be signed in to change notification settings - Fork 36
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
Remove PubGrubError::Failure
#239
Comments
I don’t have strong opinions on this. I think having a failure type instead of panics can provide better error messages since it can be unwind at the most adequate level to provide useful information as to why and in which context that error occurred. |
Looking more closely at both examples, they should clearly be panics. For the first one it's not even clear how this could be a user's fault, something in the algorithm has gone very wrong if we end up in the situation. For the second one, the user has clearly messed up, but it's not hard to provide all of the context namely what package was requested with what VS and what V was returned. On the other hand, this provided us a way to add new errors without making a breaking change. If that something we care about we should mark this enum as "nonexhaustive". |
As a user, i'd like to handle pubgrub errors exhaustively and if required match on or add context to On a related note, in uv we removed |
Seems reasonable. That all sounds good. |
PubGrubError
currently has aPubGrubError::Failure(String)
variant with two usages: "a package was chosen but we don't have a term." and "choose_package_version picked an incompatible version". Both of these only occur when breaking the dependency provider contract. We should either replace them by panics, or replace theString
with two dedicated variants.The text was updated successfully, but these errors were encountered: