From 02188572dd2c5aba834d36502a174fbc3ed09744 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 13 Oct 2007 06:46:15 +0000 Subject: [PATCH] Handle the PortageException that can be raised from portage.mail.send_mail(). (trunk r8102) svn path=/main/branches/2.1.2/; revision=8103 --- pym/elog_modules/mod_mail.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/elog_modules/mod_mail.py b/pym/elog_modules/mod_mail.py index b8e17a51a..058faa7c0 100644 --- a/pym/elog_modules/mod_mail.py +++ b/pym/elog_modules/mod_mail.py @@ -4,6 +4,8 @@ # $Id$ import portage_mail, socket +from portage_exception import PortageException +from portage_util import writemsg def process(mysettings, cpv, logentries, fulltext): if mysettings.has_key("PORTAGE_ELOG_MAILURI"): @@ -17,6 +19,9 @@ def process(mysettings, cpv, logentries, fulltext): mysubject = mysubject.replace("${HOST}", socket.getfqdn()) mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, fulltext) - portage_mail.send_mail(mysettings, mymessage) + try: + portage_mail.send_mail(mysettings, mymessage) + except PortageException, e: + writemsg("%s\n" % str(e), noiselevel=-1) return -- 2.26.2