diff options
| author | Andrew Dolgov <noreply@fakecake.org> | 2014-03-11 13:38:06 +0400 |
|---|---|---|
| committer | Andrew Dolgov <noreply@fakecake.org> | 2014-03-11 13:38:06 +0400 |
| commit | 350218f4f845942e3ef086653f84819a87e64928 (patch) | |
| tree | 48ff5cff27f4a7907a020d1780a9467eda1ecbac /js/functions.js | |
| parent | 99c19e1dcb31886e8003a0bd14416ca91491f61e (diff) | |
quickAddFeed: gracefully handle backend timeout/JSON parse problems
Diffstat (limited to 'js/functions.js')
| -rw-r--r-- | js/functions.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/functions.js b/js/functions.js index 43fae715b..1ad15fcc6 100644 --- a/js/functions.js +++ b/js/functions.js @@ -829,7 +829,14 @@ function quickAddFeed() { onComplete: function(transport) { try { - var reply = JSON.parse(transport.responseText); + try { + 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.")); + console.log('quickAddFeed, backend returned:' + transport.responseText); + return; + } var rc = reply['result']; |