Skip to content

Commit

Permalink
Consistent handling of cache access (#188)
Browse files Browse the repository at this point in the history
Mixing return None with exceptions makes it harder to handle the different failure cases.
This makes it easier as callers can simply handle the SlackError exception.
  • Loading branch information
evnsio authored Nov 15, 2019
1 parent baac71e commit 56de528
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion response/slack/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_user_profile_by_email(email):
- or else from the Slack API
"""
if not email:
return None
raise SlackError("Can't fetch user without an email")

try:
external_user = ExternalUser.objects.get(email=email)
Expand Down

0 comments on commit 56de528

Please sign in to comment.