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

Stricter validation of constructor parameters #39

Open
carbonphyber opened this issue Mar 6, 2021 · 1 comment
Open

Stricter validation of constructor parameters #39

carbonphyber opened this issue Mar 6, 2021 · 1 comment

Comments

@carbonphyber
Copy link
Contributor

carbonphyber commented Mar 6, 2021

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.

@carbonphyber
Copy link
Contributor Author

Fixed in #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant