Commit 03badefa authored by Vincent Pelletier's avatar Vincent Pelletier

Catch common mailhost errors when activity fails (eg, with a unconfigured...

Catch common mailhost errors when activity fails (eg, with a unconfigured mailhost) to avoid adding mailhost-related backtrace to activity failure backtraces in logs.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16028 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f1c48c76
...@@ -51,6 +51,7 @@ from ActivityBuffer import ActivityBuffer ...@@ -51,6 +51,7 @@ from ActivityBuffer import ActivityBuffer
from zExceptions import ExceptionFormatter from zExceptions import ExceptionFormatter
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from Products.MailHost.MailHost import MailHostError
from zLOG import LOG, INFO, WARNING from zLOG import LOG, INFO, WARNING
...@@ -230,7 +231,10 @@ Exception: %s %s ...@@ -230,7 +231,10 @@ Exception: %s %s
""" % (activity_tool.email_from_address, user_email, message, """ % (activity_tool.email_from_address, user_email, message,
message, '/'.join(self.object_path), self.method_id, message, '/'.join(self.object_path), self.method_id,
self.exc_type, self.exc_value, self.traceback) self.exc_type, self.exc_value, self.traceback)
try:
activity_tool.MailHost.send( mail_text ) activity_tool.MailHost.send( mail_text )
except (socket.error, MailHostError), message:
LOG('ActivityTool.notifyUser', WARNING, 'Mail containing failure information failed to be sent: %s' % (message, ))
def reactivate(self, activity_tool): def reactivate(self, activity_tool):
# Reactivate the original object. # Reactivate the original object.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment