Commit 0f81bdce by Julian Arni

Properly handle error responses

parent cdf0eef5
......@@ -77,15 +77,10 @@ $('#fileupload').fileupload({
e.preventDefault();
submitBtn.hide();
data.submit().complete(function(result, textStatus, xhr) {
if (result.status != 200 && result.status != 302) {
alert('${_("Your import has failed.")}\n\n' + JSON.parse(result.responseText)["ErrMsg"]);
if (xhr.status != 200) {
alert('${_("Your import has failed.")}\n\n' + result["ErrMsg"]);
submitBtn.show();
bar.hide();
} else {
if (result.responseText["ImportStatus"] == 1) {
bar.hide();
statusBlock.show();
}
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment