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:
parent
1262479ad3
commit
84bfc8aa91
1 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue