From f93a141a7379cdb888fcb3c1a1acc6849a1dbd23 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 15 Nov 2018 16:22:13 +0530 Subject: [PATCH] fix(email-queue): Record raised exception and traceback in Error Log --- frappe/email/queue.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/email/queue.py b/frappe/email/queue.py index b018660d0a..f3a5487c93 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -206,8 +206,9 @@ def get_email_queue(recipients, sender, subject, **kwargs): except frappe.InvalidEmailAddressError: # bad Email Address - don't add to queue - frappe.log_error('Invalid Email ID Sender: {0}, Recipients: {1}'.format(mail.sender, - ', '.join(mail.recipients)), 'Email Not Sent') + import traceback + frappe.log_error('Invalid Email ID Sender: {0}, Recipients: {1}, \nTraceback: {2} '.format(mail.sender, + ', '.join(mail.recipients), traceback.format_exc()), 'Email Not Sent') recipients = list(set(recipients + kwargs.get('cc', []) + kwargs.get('bcc', []))) e.set_recipients(recipients)