Skip to content

Commit fa68b4d

Browse files
committed
Fix error handling in mailer
1 parent e327c7c commit fa68b4d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

insalan/mailer.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,13 @@ def send_first_mail(self):
193193
"""
194194
if len(self.queue) == 0:
195195
return
196-
self.queue[0].send()
197-
self.queue.pop(0)
196+
try:
197+
self.queue[0].send()
198+
self.queue.pop(0)
199+
except Exception as e:
200+
print("Error sending mail", e, file=sys.stderr)
201+
mail = self.queue.pop(0)
202+
self.queue.append(mail)
198203

199204
class MailManager:
200205
"""

0 commit comments

Comments
 (0)