Преглед на файлове

Pass if unable to handle failed ajax response (#3797)

version-14
Nabin Hait преди 8 години
committed by Rushabh Mehta
родител
ревизия
ff248fd4fa
променени са 1 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. +13
    -8
      frappe/public/js/frappe/request.js

+ 13
- 8
frappe/public/js/frappe/request.js Целия файл

@@ -177,8 +177,8 @@ frappe.request.call = function(opts) {
status_code_handler(data, xhr);
}
} catch(e) {
console.log("Unable to handle response");
console.trace(e);
console.log("Unable to handle success response"); // eslint-disable-line
console.trace(e); // eslint-disable-line
}
})
@@ -201,12 +201,17 @@ frappe.request.call = function(opts) {
}
})
.fail(function(xhr, textStatus) {
var status_code_handler = statusCode[xhr.statusCode().status];
if (status_code_handler) {
status_code_handler(xhr);
} else {
// if not handled by error handler!
opts.error_callback && opts.error_callback(xhr);
try {
var status_code_handler = statusCode[xhr.statusCode().status];
if (status_code_handler) {
status_code_handler(xhr);
} else {
// if not handled by error handler!
opts.error_callback && opts.error_callback(xhr);
}
} catch(e) {
console.log("Unable to handle failed response"); // eslint-disable-line
console.trace(e); // eslint-disable-line
}
});
}


Зареждане…
Отказ
Запис