From 0243981f314c330d05fddb1f2da48f2046f5bbbc Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 4 May 2020 11:08:44 +0530 Subject: [PATCH] fix: handle exception if sending Appointment Confirmation message fails (#21569) --- .../doctype/patient_appointment/patient_appointment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py index 512d44ec37..c4ec30f046 100755 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py @@ -325,7 +325,11 @@ def update_status(appointment_id, status): def send_confirmation_msg(doc): if frappe.db.get_single_value('Healthcare Settings', 'send_appointment_confirmation'): message = frappe.db.get_single_value('Healthcare Settings', 'appointment_confirmation_msg') - send_message(doc, message) + try: + send_message(doc, message) + except Exception: + frappe.log_error(frappe.get_traceback(), _('Appointment Confirmation Message Not Sent')) + frappe.msgprint(_('Appointment Confirmation Message Not Sent'), indicator='orange') @frappe.whitelist()