-
Notifications
You must be signed in to change notification settings - Fork 462
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
Introduce custom exceptions [WIP] #1328
base: dev
Are you sure you want to change the base?
Conversation
LGTM, though we might want to add actionable suggestions on top of existing errors as the ones slowly rolled out by the Python Foundation since 3.10 release. For example, rather than:
We might want to change to:
Or even better, get this to read from
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I continue to have some doubts about the need for exceptions for Israel and (especially) Japan, but I like the idea of custom exceptions. 👍
|
Yeah, I forgot that exists somehow 💀 |
So the general idea is to make the error messages more descriptive, right?
This can be addressed separately, however I'd like to hear more on why the year out of range exception makes you being doubtful. |
These two countries are not so "exceptional" that a special scheme should be applied to them. 🙂 Start year - as for many other countries it's a year when current holidays list was established. We typically use |
Right, same goes for cases where user's country input doesn't exists due to typo i.e. Did you mean 'Libya'? |
My plan is to introduce start/end year control later and raise or warn when user requests holidays out of range of supported years (instead of returning an empty dict). Both start/end year range would be optional and enforced if they were set only. So I guess
That's a good user experience suggestion. Eventually we'd like to have this implemented 👍 |
I removed |
SonarCloud Quality Gate failed. 2 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Proposed change
This PR Introduces PH custom exceptions. The goal is to share it early in order to gather naming and use case suggestions.
This is a breaking change. The documentation updates are coming soon.
Type of change
Checklist
beta
branch of the repositorymake pre-commit
make test
,make tox
(we strongly encourage adding tests to your code)