From 9f92e7bf0d9a7ebd4f10da113dcb7867228f4c03 Mon Sep 17 00:00:00 2001 From: shariquerik Date: Wed, 15 Apr 2026 12:02:20 +0530 Subject: [PATCH] fix: enhance error handling in password reset process --- frappe/core/doctype/user/user.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index f7d8e19cf1..797894f99d 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -1167,7 +1167,12 @@ def reset_password(user: str) -> str: # For Administrator or disabled users: silently skip — same response below except frappe.DoesNotExistError: frappe.clear_messages() - # Do not reveal whether the account exists — fall through to generic response + except frappe.OutgoingEmailError: + frappe.clear_messages() + frappe.log_error(title="Password reset email could not be sent", message=frappe.get_traceback()) + except Exception: + frappe.clear_messages() + frappe.log_error(title="Password reset failed unexpectedly", message=frappe.get_traceback()) return frappe.msgprint( msg=_("If an account with this email exists, password reset instructions have been sent."),