mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
[common.js] modified ajaxErrorHandler
This commit is contained in:
@@ -151,18 +151,8 @@ define([
|
|||||||
|
|
||||||
ajaxErrorHandler: function(xhr, textStatus, errorThrown) {
|
ajaxErrorHandler: function(xhr, textStatus, errorThrown) {
|
||||||
if (xhr.responseText) {
|
if (xhr.responseText) {
|
||||||
|
|
||||||
var parsed_resp = $.parseJSON(xhr.responseText);
|
var parsed_resp = $.parseJSON(xhr.responseText);
|
||||||
|
this.feedback(parsed_resp.error||parsed_resp.error_msg, 'error');
|
||||||
if (parsed_resp.hasOwnProperty('error')) {
|
|
||||||
/* error msg from seahub ajax */
|
|
||||||
this.feedback(parsed_resp.error, 'error');
|
|
||||||
} else if (parsed_resp.hasOwnProperty('error_msg')) {
|
|
||||||
/* error msg from seahub api */
|
|
||||||
this.feedback(parsed_resp.error_msg, 'error');
|
|
||||||
} else {
|
|
||||||
this.feedback(gettext("Error"), 'error');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.feedback(gettext("Failed. Please check the network."), 'error');
|
this.feedback(gettext("Failed. Please check the network."), 'error');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user