From 84bfc8aa916f7908d770893fd6720c07a201e32d Mon Sep 17 00:00:00 2001 From: Sayantan Ghosh Date: Wed, 18 Feb 2026 11:30:27 +0530 Subject: [PATCH] fix: `frappe.call` for website now handles 417 errors (#32362) this is to bring parity between the two `frappe.call` methods: one for the website and one for the framework. --- frappe/website/js/website.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frappe/website/js/website.js b/frappe/website/js/website.js index 4ae6d614cc..6a8221f68a 100644 --- a/frappe/website/js/website.js +++ b/frappe/website/js/website.js @@ -96,6 +96,18 @@ $.extend(frappe, { 403: function () { frappe.msgprint(__("Not permitted")); }, + 417: function (xhr) { + var data = xhr.responseJSON; + if (!data) { + try { + data = JSON.parse(xhr.responseText); + } catch (e) { + data = xhr.responseText; + } + } + if (opts.callback) opts.callback(data); + if (opts.error) opts.error(data); + }, 200: function (data) { if (opts.callback) opts.callback(data); if (opts.success) opts.success(data);