This would permanently mark the mail as failed while
there is a good chance it will be sent properly next
time it is retried (provided the memory situation
improves or the server/worker has restarted).
bzr revid: odo@openerp.com-
20140430102552-qkwv20b20nve64th
# see revid:odo@openerp.com-20120622152536-42b2s28lvdv3odyr in 6.1
if mail_sent:
self._postprocess_sent_message(cr, uid, mail, context=context)
+ except MemoryError:
+ # prevent catching transient MemoryErrors, bubble up to notify user or abort cron job
+ # instead of marking the mail as failed
+ raise
except Exception:
_logger.exception('failed sending mail.mail %s', mail.id)
mail.write({'state': 'exception'})