don't fail on error while render a notification mail stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 02 Dec 2009 11:04:40 +0100
branchstable
changeset 3960 8cbf18c703be
parent 3958 505025eb0d37
child 3961 d1cbf77db999
don't fail on error while render a notification mail
common/mail.py
--- a/common/mail.py	Tue Dec 01 19:29:56 2009 +0100
+++ b/common/mail.py	Wed Dec 02 11:04:40 2009 +0100
@@ -198,6 +198,11 @@
                 subject = self.subject()
             except SkipEmail:
                 continue
+            except Exception, ex:
+                # shouldn't make the whole transaction fail because of rendering
+                # error (unauthorized or such)
+                self.exception(str(ex))
+                continue
             msg = format_mail(self.user_data, [emailaddr], content, subject,
                               config=self.config, msgid=msgid, references=refs)
             yield [emailaddr], msg