www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 4d7fc6b10c2e0044a3a422a71d7bac0caf724071
parent e38c86cba24b9b3369a3958d57ce121164704261
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  5 Sep 2008 04:29:34 +0000

Include response text from server in error log on Invalid Response sync error


Diffstat:
Mchrome/content/zotero/xpcom/sync.js | 21++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -1014,7 +1014,7 @@ Zotero.Sync.Server = new function () { } if (response.firstChild.tagName != 'locked') { - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } _sessionLock = true; @@ -1055,7 +1055,7 @@ Zotero.Sync.Server = new function () { } if (response.firstChild.tagName != 'unlocked') { - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } _sessionLock = null; @@ -1099,7 +1099,7 @@ Zotero.Sync.Server = new function () { } if (response.firstChild.tagName != 'cleared') { - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } Zotero.Sync.Server.resetClient(); @@ -1146,7 +1146,7 @@ Zotero.Sync.Server = new function () { } if (response.firstChild.tagName != 'reset') { - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } _syncInProgress = false; @@ -1191,7 +1191,7 @@ Zotero.Sync.Server = new function () { } if (response.firstChild.tagName != 'loggedout') { - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } if (callback) { @@ -1206,7 +1206,7 @@ Zotero.Sync.Server = new function () { !xmlhttp.responseXML.childNodes[0] || xmlhttp.responseXML.childNodes[0].tagName != 'response') { Zotero.debug(xmlhttp.responseText); - _error('Invalid response from server'); + _error('Invalid response from server', xmlhttp.responseText); } if (!xmlhttp.responseXML.childNodes[0].firstChild) { @@ -1230,7 +1230,14 @@ Zotero.Sync.Server = new function () { } - function _error(e) { + function _error(e, extraInfo) { + if (extraInfo) { + // Server errors will generally be HTML + var ZU = new Zotero.Utilities + extraInfo = ZU.unescapeHTML(extraInfo); + Components.utils.reportError(extraInfo); + } + _syncInProgress = false; _resetAttempts(); Zotero.DB.rollbackAllTransactions();