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

GeckoVersion raises too many different errors when it can't parse a version #76

Open
JohanLorenzo opened this issue Nov 16, 2020 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@JohanLorenzo
Copy link
Contributor

This is what GeckoVersion raises:

Raises:
PatternNotMatchedError: if the string doesn't match the pattern of a valid version number
MissingFieldError: if a mandatory field is missing in the string. Mandatory fields are
`major_number` and `minor_number`
ValueError: if an integer can't be cast or is not (strictly) positive
TooManyTypesError: if the string matches more than 1 `VersionType`
NoVersionTypeError: if the string matches none.

I initially thought it would be a good idea to have distinct error types, but after years of use, mozilla-version users just would like to know if a version was correctly parsed or not. It would be great to change GeckoVersion (and likely BaseVersion too) to just return a single error type.

@JohanLorenzo JohanLorenzo added bug Something isn't working good first issue Good for newcomers labels Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant