Catch "script stack space quota is exhausted" sync error and display an upgrade message

This commit is contained in:
Dan Stillman 2011-02-07 07:33:20 +00:00
parent a85a52dec0
commit 45c4d15128

View file

@ -1350,12 +1350,12 @@ Zotero.Sync.Server = new function () {
_error(response.firstChild.firstChild.nodeValue);
}
var xml = xmlhttp.responseText.replace(/^\s*<\?xml.*\?>\s*/, '').trim();
// Strip XML declaration and convert to E4X
xml = new XML(xml);
try {
var xml = xmlhttp.responseText.replace(/^\s*<\?xml.*\?>\s*/, '').trim();
// Strip XML declaration and convert to E4X
xml = new XML(xml);
var updateKey = xml.@updateKey.toString();
// If no earliest date is provided by the server, the server
@ -2219,6 +2219,10 @@ Zotero.Sync.Server = new function () {
}
}
if (e.message == 'script stack space quota is exhausted') {
var e = "Firefox 4.0 or higher is required to process sync operations of this size.";
}
if (extraInfo) {
// Server errors will generally be HTML
extraInfo = Zotero.Utilities.unescapeHTML(extraInfo);