-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implemented py-lockdown-cafe #545
base: master
Are you sure you want to change the base?
Conversation
app/cafe.py
Outdated
def visit_cafe(self, | ||
visitor: dict | ||
) -> (str | ||
| NotVaccinatedError | ||
| OutdatedVaccineError | ||
| NotWearingMaskError): |
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.
the function doesn't return errors it raises them
app/cafe.py
Outdated
def visit_cafe(self, | ||
visitor: dict | ||
) -> (str |
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.
fix indentation
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.
the same in other similar cases
app/cafe.py
Outdated
raise OutdatedVaccineError | ||
|
||
if not visitor.get("wearing_a_mask", False): | ||
raise NotWearingMaskError(masks_to_buy=0) |
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.
maybe it's better to use a default value for your custom error?
except NotWearingMaskError as e: | ||
if not not_wearing_mask_error: | ||
not_wearing_mask_error = e | ||
if not_wearing_mask_error: |
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.
why didn't use else?
No description provided.