]> git.wh0rd.org - tt-rss.git/commitdiff
add a less intimidating error message when backend times out and/or fails to return...
authorAndrew Dolgov <noreply@fakecake.org>
Tue, 11 Mar 2014 09:59:14 +0000 (13:59 +0400)
committerAndrew Dolgov <noreply@fakecake.org>
Tue, 11 Mar 2014 09:59:14 +0000 (13:59 +0400)
js/functions.js
js/tt-rss.js

index 1ad15fcc672a2d7c3c45bbdc9273f6d91f2ccdae..93b0371524f8e797b8cbc68a7ba44ef3d8963fc2 100644 (file)
@@ -833,7 +833,7 @@ function quickAddFeed() {
                                                                        var reply = JSON.parse(transport.responseText);
                                                                } catch (e) {
                                                                        Element.hide("feed_add_spinner");
-                                                                       alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to browser console."));
+                                                                       alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to the browser console."));
                                                                        console.log('quickAddFeed, backend returned:' + transport.responseText);
                                                                        return;
                                                                }
index bb23169ec16ce91866cb7d9876c023bca01c4fe1..3b7793553a94b13dcb8a659f86717d1fe0fa723c 100644 (file)
@@ -987,7 +987,12 @@ function newVersionDlg() {
 
 function handle_rpc_json(transport, scheduled_call) {
        try {
-               var reply = JSON.parse(transport.responseText);
+               try {
+                       var reply = JSON.parse(transport.responseText);
+               } catch (e) {
+                       alert(__("Failed to parse server reply. This could be caused by a server or network timeout. Backend output was logged to the browser console."));
+                       console.log("handle_rpc_json, received: " + transport.responseText);
+               }
 
                if (reply) {