More accurate error message on server error (instead of "Empty response from server")

This commit is contained in:
Dan Stillman 2008-10-29 19:01:32 +00:00
parent d69fde6731
commit 6f4414ed4d

View file

@ -1151,11 +1151,11 @@ Zotero.Sync.Server = new function () {
function _checkResponse(xmlhttp) {
if (!xmlhttp.responseXML) {
if (!xmlhttp.responseText) {
_error('Empty response from server');
}
if ( !xmlhttp.responseXML.childNodes[0] ||
if (!xmlhttp.responseXML || !xmlhttp.responseXML.childNodes[0] ||
xmlhttp.responseXML.childNodes[0].tagName != 'response') {
Zotero.debug(xmlhttp.responseText);
_error('Invalid response from server', xmlhttp.responseText);