From 98843efd6459347fec119f271885bc7274c59203 Mon Sep 17 00:00:00 2001 From: benne238 Date: Mon, 1 Feb 2021 14:30:27 -0500 Subject: [PATCH] explicit error handling for spliting and invalid email address --- api/ECNQueue.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 668299c..cb5cd41 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -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":