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.
This commit is contained in:
Sayantan Ghosh 2026-02-18 11:30:27 +05:30 committed by GitHub
parent 1262479ad3
commit 84bfc8aa91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);