From: Andrew Dolgov Date: Sun, 16 Oct 2005 14:15:32 +0000 (+0100) Subject: add some RPC error reporting X-Git-Tag: 1.0.7~51 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bc18bcddc6cfbc9cbb2b824e76fd3ce4ee486bf2;p=tt-rss.git add some RPC error reporting --- diff --git a/functions.js b/functions.js index d79490a4..323d7d8a 100644 --- a/functions.js +++ b/functions.js @@ -307,6 +307,12 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') { function label_counters_callback() { if (xmlhttp_rpc.readyState == 4) { + + if (!xmlhttp.responseXML) { + notify("label_counters_callback: backend did not return valid XML"); + return; + } + var reply = xmlhttp_rpc.responseXML.firstChild; var f_document = parent.frames["feeds-frame"].document; diff --git a/tt-rss.js b/tt-rss.js index c5a57e1f..35b7c9fb 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -70,8 +70,18 @@ function refetch_callback() { document.title = "Tiny Tiny RSS"; notify("All feeds updated."); + if (!xmlhttp.responseXML) { + notify("refetch_callback: backend did not return valid XML"); + return; + } + var reply = xmlhttp.responseXML.firstChild; + if (!reply) { + notify("refetch_callback: backend did not return expected XML object"); + return; + } + var f_document = window.frames["feeds-frame"].document; for (var l = 0; l < reply.childNodes.length; l++) {