summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2014-03-11 13:59:14 +0400
committerAndrew Dolgov <[email protected]>2014-03-11 13:59:14 +0400
commit2ffe7a3b14caeb55a6338d769255cafa6f67d3c6 (patch)
tree282c8225f381c65f0327a13e0db5fb61ff90b4fe /js
parent9e52809d1a91d6d3b8c4b0f12d5b25acd65a52e7 (diff)
add a less intimidating error message when backend times out and/or fails to return valid JSON
Diffstat (limited to 'js')
-rw-r--r--js/functions.js2
-rw-r--r--js/tt-rss.js7
2 files changed, 7 insertions, 2 deletions
diff --git a/js/functions.js b/js/functions.js
index 1ad15fcc6..93b037152 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -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;
}
diff --git a/js/tt-rss.js b/js/tt-rss.js
index bb23169ec..3b7793553 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -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) {