From 1c1e9870a9122c4ee4b06cef682cc2f9c8c08ec1 Mon Sep 17 00:00:00 2001 From: llj Date: Mon, 7 Sep 2015 17:55:35 +0800 Subject: [PATCH] [common.js] modified ajaxErrorHandler --- static/scripts/common.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/static/scripts/common.js b/static/scripts/common.js index 94d6f780ae..7b9627729e 100644 --- a/static/scripts/common.js +++ b/static/scripts/common.js @@ -151,18 +151,8 @@ define([ ajaxErrorHandler: function(xhr, textStatus, errorThrown) { if (xhr.responseText) { - var parsed_resp = $.parseJSON(xhr.responseText); - - 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'); - } + this.feedback(parsed_resp.error||parsed_resp.error_msg, 'error'); } else { this.feedback(gettext("Failed. Please check the network."), 'error'); }