Skip to content

Commit

Permalink
explicit error handling for spliting and invalid email address
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Feb 1, 2021
1 parent cb7a5fd commit 98843ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,11 +1201,12 @@ def __getUserAlias(self) -> str:
str: User's Career Account alias if present or empty string
"""

# Returns an error parse if the useremail isn't valid

try:
emailUser, emailDomain = self.userEmail.split("@")

except:
# Returns an error parse if the self.useremail doesn't contain exactally one "@" symbol
except ValueError:
# Parses through the self.headers list to find the "From" header and its line number
for lineNum, header in enumerate(self.headers):
if header["type"] == "From":
Expand Down

0 comments on commit 98843ef

Please sign in to comment.