Merge pull request #27152 from barredterra/handle-errors-during-error-handling

fix(Email Account): handle errors during error handling
This commit is contained in:
Akhil Narang 2024-07-17 19:13:35 +05:30 committed by GitHub
commit 23539e3dc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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()