Skip to content

Commit

Permalink
add error checking regarding local test emails
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan7n committed Jul 31, 2023
1 parent 9c1a7d8 commit 2aa745e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/medperf/comms/auth/local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from medperf.comms.auth.interface import Auth
import medperf.config as config
from medperf.exceptions import InvalidArgumentError
from medperf.account_management import (
set_credentials,
read_credentials,
Expand All @@ -20,7 +21,13 @@ def login(self, email):
email (str): user email.
"""

access_token = self.tokens[email]
try:
access_token = self.tokens[email]
except KeyError:
raise InvalidArgumentError(
"The provided email does not exist for testing. "
"Make sure you activated the right profile."
)
refresh_token = "refresh token"
id_token_payload = {"email": email}
token_issued_at = 0
Expand Down

0 comments on commit 2aa745e

Please sign in to comment.