Skip to content

Stricter validation of constructor parameters #39

@carbonphyber

Description

@carbonphyber

I find libraries that raising Exceptions early and often when users pass in invalid/unsupported much more pleasant to work with.

I'm developing a partial rewrite of the jurisdiction.py constructor to raise exceptions if:

  • the url parameter is invalid
  • the string is not a URL
  • the url string is not from a supported hostname

Since raising Exceptions in a potential future version where none are raised now is a breaking change, I'm submitting this Issue to gather feedback before submitting the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions