aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/mail.py
diff options
context:
space:
mode:
authorJonathan Sandoval <jsandoval@utp.edu.co>2016-04-08 13:21:31 -0500
committerJonathan Sandoval <jsandoval@utp.edu.co>2016-04-08 13:21:31 -0500
commitb2bc8e654efae0b94185960a65273ed410cf8874 (patch)
tree451a7a48aa2ecd91886e5447c09b2e9216897091 /mediagoblin/tools/mail.py
parentcaee9aa2e3a9d12e924f56149c29063dad8025e5 (diff)
downloadmediagoblin-b2bc8e654efae0b94185960a65273ed410cf8874.tar.lz
mediagoblin-b2bc8e654efae0b94185960a65273ed410cf8874.tar.xz
mediagoblin-b2bc8e654efae0b94185960a65273ed410cf8874.zip
Include original error in debug log
Diffstat (limited to 'mediagoblin/tools/mail.py')
-rw-r--r--mediagoblin/tools/mail.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/tools/mail.py b/mediagoblin/tools/mail.py
index 8161a324..3dc180d8 100644
--- a/mediagoblin/tools/mail.py
+++ b/mediagoblin/tools/mail.py
@@ -115,22 +115,22 @@ def send_email(from_addr, to_addrs, subject, message_body):
mhost = smtp_init(
mg_globals.app_config['email_smtp_host'],
mg_globals.app_config['email_smtp_port'])
- except socket.error:
+ except socket.error as original_error:
error_message = "Couldn't contact mail server on <{}>:<{}>".format(
mg_globals.app_config['email_smtp_host'],
mg_globals.app_config['email_smtp_port'])
- logging.debug(error_message)
+ logging.debug(original_error)
raise NoSMTPServerError(error_message)
# SMTP.__init__ Issues SMTP.connect implicitly if host
if not mg_globals.app_config['email_smtp_host']: # e.g. host = ''
try:
mhost.connect() # We SMTP.connect explicitly
- except socket.error:
+ except socket.error as original_error:
error_message = "Couldn't contact mail server on <{}>:<{}>".format(
mg_globals.app_config['email_smtp_host'],
mg_globals.app_config['email_smtp_port'])
- logging.debug(error_message)
+ logging.debug(original_error)
raise NoSMTPServerError(error_message)
try: