Skip to content

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

@JohanLorenzo

Description

@JohanLorenzo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions