commit b4ac8b949e04f4a6c6e48baaab2beeb7105e57d5
parent 9b9a45052749a506c0f6ad8025ad73d8ce63c9a6
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 22 Sep 2008 21:55:14 +0000
More explicit error when responseXML is null
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js
@@ -1202,14 +1202,18 @@ Zotero.Sync.Server = new function () {
function _checkResponse(xmlhttp) {
- if (!xmlhttp.responseXML ||
- !xmlhttp.responseXML.childNodes[0] ||
+ if (!xmlhttp.responseXML) {
+ _error('Empty response from server');
+ }
+
+ if ( !xmlhttp.responseXML.childNodes[0] ||
xmlhttp.responseXML.childNodes[0].tagName != 'response') {
Zotero.debug(xmlhttp.responseText);
_error('Invalid response from server', xmlhttp.responseText);
}
if (!xmlhttp.responseXML.childNodes[0].firstChild) {
+ Zotero.debug(xmlhttp.responseText);
_error('Empty response from server');
}
}