Mercurial > hg > gcmultimerge
comparison multimerge.py @ 70:d5e3ca4b609d
Improve error handling when e-mail sending fails.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 12 Jul 2016 10:27:13 +0300 |
parents | 42b6acc5988e |
children | 41881ba09ba8 |
comparison
equal
deleted
inserted
replaced
69:8ef792b573a9 | 70:d5e3ca4b609d |
---|---|
61 msg["To"] = ",".join(cfg.email_to) | 61 msg["To"] = ",".join(cfg.email_to) |
62 try: | 62 try: |
63 smtpH = smtplib.SMTP('localhost') | 63 smtpH = smtplib.SMTP('localhost') |
64 smtpH.sendmail(cfg.email_sender, cfg.email_to, msg.as_string()) | 64 smtpH.sendmail(cfg.email_sender, cfg.email_to, msg.as_string()) |
65 smtpH.quit() | 65 smtpH.quit() |
66 except: | 66 except Exception as e: |
67 gcm_print(u"FATAL: Oh crap, e-mail sending failed.") | 67 gcm_print(u"FATAL: Oh crap, e-mail sending failed: {0}".format(str(e))) |
68 sys.exit(1) | 68 sys.exit(1) |
69 | 69 |
70 | 70 |
71 ## Debug messages | 71 ## Debug messages |
72 def gcm_debug(smsg): | 72 def gcm_debug(smsg): |