From 85f66c083e22d5708588d944ecfc3dcd4f5b3af0 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 27 Mar 2024 18:43:49 +0530 Subject: [PATCH] fix: preserve original error message (#25682) --- frappe/email/smtp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/email/smtp.py b/frappe/email/smtp.py index 78191954229..12d8af38f3a 100644 --- a/frappe/email/smtp.py +++ b/frappe/email/smtp.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.email.oauth import Oauth -from frappe.utils import cint, cstr +from frappe.utils import cint, cstr, get_traceback class InvalidEmailCredentials(frappe.ValidationError): @@ -129,8 +129,9 @@ def quit(self): @classmethod def throw_invalid_credentials_exception(cls): + original_exception = get_traceback() or "\n" frappe.throw( - _("Please check your email login credentials."), + _("Please check your email login credentials.") + " " + original_exception.splitlines()[-1], title=_("Invalid Credentials"), exc=InvalidEmailCredentials, )