Don't show response text on HTTP error if empty

This commit is contained in:
Dan Stillman 2017-04-11 04:18:10 -04:00
parent 5d6478e507
commit 747290be38

View file

@ -252,8 +252,10 @@ Zotero.HTTP = new function() {
}
deferred.resolve(xmlhttp);
} else {
let msg = "HTTP " + method + " " + dispURL + " failed with status code " + xmlhttp.status
+ ":\n\n" + xmlhttp.responseText;
let msg = "HTTP " + method + " " + dispURL + " failed with status code " + xmlhttp.status;
if (xmlhttp.responseText) {
msg += ":\n\n" + xmlhttp.responseText;
}
Zotero.debug(msg, 1);
deferred.reject(new Zotero.HTTP.UnexpectedStatusException(xmlhttp, msg));
}