From 00bd7ec8becc695acf04703780d73867273160b7 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 16 2017 16:09:28 +0000 Subject: Don't crash on e-mailing errors --- diff --git a/util/koji-gc b/util/koji-gc index fd4aa26..1a5a597 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -419,9 +419,13 @@ refer to the document linked above for instructions.""" else: if options.debug: print "Sending warning notice to %s" % msg['To'] - s = smtplib.SMTP(options.smtp_host) - s.sendmail(msg['From'], msg['To'], msg.as_string()) - s.quit() + try: + s = smtplib.SMTP(options.smtp_host) + s.sendmail(msg['From'], msg['To'], msg.as_string()) + s.quit() + except Exception, ex: + print "Sending e-mail to %s failed: %s" % (msg['To'], ex) + def main(args):