mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
[ajax] fixup for error msg (#2183)
This commit is contained in:
@@ -82,18 +82,9 @@ define([
|
||||
reset: true,
|
||||
success: function (collection, response, opts) {
|
||||
},
|
||||
error: function (collection, response, opts) {
|
||||
error: function(collection, response, opts) {
|
||||
var err_msg = Common.prepareCollectionFetchErrorMsg(collection, response, opts);
|
||||
_this.$loadingTip.hide();
|
||||
var err_msg;
|
||||
if (response.responseText) {
|
||||
if (response['status'] == 401 || response['status'] == 403) {
|
||||
err_msg = gettext("Permission error");
|
||||
} else {
|
||||
err_msg = gettext("Error");
|
||||
}
|
||||
} else {
|
||||
err_msg = gettext('Please check the network.');
|
||||
}
|
||||
_this.$error.html(err_msg).show();
|
||||
}
|
||||
});
|
||||
@@ -142,13 +133,8 @@ define([
|
||||
Common.closeModal();
|
||||
},
|
||||
error: function(collection, response, options) {
|
||||
var err_msg;
|
||||
if (response.responseText) {
|
||||
err_msg = response.responseJSON.error_msg;
|
||||
} else {
|
||||
err_msg = gettext('Please check the network.');
|
||||
}
|
||||
$error.html(err_msg).show();
|
||||
var error_msg = Common.prepareAjaxErrorMsg(response);
|
||||
$error.html(error_msg).show();
|
||||
Common.enableButton($submitBtn);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user