fix(Email Account): handle errors during error handling

This commit is contained in:
barredterra 2024-07-17 13:20:09 +02:00
parent cb90ce463d
commit eb28a7322b

View file

@ -599,10 +599,15 @@ class EmailAccount(Document):
frappe.db.rollback()
except Exception:
frappe.db.rollback()
self.log_error(title="EmailAccount.receive")
if self.use_imap:
self.handle_bad_emails(mail.uid, mail.raw_message, frappe.get_traceback())
exceptions.append(frappe.get_traceback())
try:
self.log_error(title="EmailAccount.receive")
if self.use_imap:
self.handle_bad_emails(mail.uid, mail.raw_message, frappe.get_traceback())
exceptions.append(frappe.get_traceback())
except Exception:
frappe.db.rollback()
else:
frappe.db.commit()
else:
frappe.db.commit()