From da0894d53757a79cd98dc0b57c870934331ad8ab Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 13 Oct 2007 06:44:06 +0000 Subject: [PATCH] Handle the PortageException that can be raised from portage.mail.send_mail(). svn path=/main/trunk/; revision=8102 --- pym/portage/elog/mod_mail.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pym/portage/elog/mod_mail.py b/pym/portage/elog/mod_mail.py index c9fa5b563..922ea0846 100644 --- a/pym/portage/elog/mod_mail.py +++ b/pym/portage/elog/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, key, logentries, fulltext): if mysettings.has_key("PORTAGE_ELOG_MAILURI"): @@ -32,6 +34,9 @@ def process(mysettings, key, logentries, fulltext): mysubject = mysubject.replace("${ACTION}", action) 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