]> git.wh0rd.org Git - tt-rss.git/commitdiff
add some RPC error reporting
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 16 Oct 2005 14:15:32 +0000 (15:15 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 16 Oct 2005 14:15:32 +0000 (15:15 +0100)
functions.js
tt-rss.js

index d79490a416aedb56ff08896fd0fde90311a097bc..323d7d8af4060bf35923d68510fe26be1c460d06 100644 (file)
@@ -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;
index c5a57e1fab0a7cc911afec1f0974bef9d73a3cb8..35b7c9fbe5672ceff4d3c8efd4330f9a6925bdcc 100644 (file)
--- 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++) {