From 97f38546626378ac5255a2e15db78f4b66ab72f2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 Apr 2016 05:21:45 -0400 Subject: [PATCH] Include 400 response in logged sync errors --- chrome/content/zotero/xpcom/http.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index 7ee49f5430..0575af711d 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -252,10 +252,11 @@ Zotero.HTTP = new function() { } deferred.resolve(xmlhttp); } else { - var msg = "HTTP " + method + " " + dispURL + " failed: " - + "Unexpected status code " + xmlhttp.status; + let msg = "HTTP " + method + " " + dispURL + " failed with status code " + xmlhttp.status; + if (xmlhttp.status == 400 || options.debug) { + msg += ":\n\n" + xmlhttp.responseText; + } Zotero.debug(msg, 1); - Zotero.debug(xmlhttp.responseText, 1); deferred.reject(new Zotero.HTTP.UnexpectedStatusException(xmlhttp, msg)); } };