summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-13 06:44:06 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-13 06:44:06 +0000
commitda0894d53757a79cd98dc0b57c870934331ad8ab (patch)
tree3f5c08de326fd68b26432605a0d4efda0118942a
parent249f2ae314902fe65f9def64ac9b9ab7e060a75f (diff)
downloadportage-da0894d53757a79cd98dc0b57c870934331ad8ab.tar.gz
portage-da0894d53757a79cd98dc0b57c870934331ad8ab.tar.bz2
portage-da0894d53757a79cd98dc0b57c870934331ad8ab.zip
Handle the PortageException that can be raised from
portage.mail.send_mail(). svn path=/main/trunk/; revision=8102
-rw-r--r--pym/portage/elog/mod_mail.py7
1 files changed, 6 insertions, 1 deletions
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