Log HTTP error bodies when responseType is explicitly set to 'text'

Previously they were only logged if responseType wasn't set
This commit is contained in:
Dan Stillman 2020-10-14 19:28:04 -04:00
parent 828ec4010e
commit e9afd153e9

View file

@ -504,7 +504,7 @@ Zotero.HTTP = new function() {
deferred.resolve(xmlhttp);
} else {
let msg = "HTTP " + method + " " + dispURL + " failed with status code " + status;
if (!xmlhttp.responseType && xmlhttp.responseText) {
if ((!xmlhttp.responseType || xmlhttp.responseType == 'text') && xmlhttp.responseText) {
msg += ":\n\n" + xmlhttp.responseText;
}
Zotero.debug(msg, 1);