More explicit error when responseXML is null
This commit is contained in:
parent
9b9a450527
commit
b4ac8b949e
1 changed files with 6 additions and 2 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue