Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

send_email: Chain the EmailNotDeliveredError from the original error.

Alex Vandiver6384bb617141
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py
index 8a98c964ecd..34beccb6d2f 100644
--- a/zerver/lib/send_email.py
+++ b/zerver/lib/send_email.py
@@ -335,11 +335,11 @@ def send_immediate_email(
stack_info=True,
)
connection.close()
- raise EmailNotDeliveredError
+ raise EmailNotDeliveredError from e
except (smtplib.SMTPException, OSError) as e:
logger.exception("Error sending %s email to %s: %s", template, mail.to, e, stack_info=True)
connection.close()
- raise EmailNotDeliveredError
+ raise EmailNotDeliveredError from e
def send_email(