commit 747290be38c835d9ee37bc6ed4cbc338c011835d parent 5d6478e5075d8f7fb681d9a8b11ba3716c2aeb42 Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 11 Apr 2017 04:18:10 -0400 Don't show response text on HTTP error if empty Diffstat:
| M | chrome/content/zotero/xpcom/http.js | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js @@ -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)); }