summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-11-09 11:00:24 +0100
committerAndrew Dolgov <[email protected]>2006-11-09 11:00:24 +0100
commit4724a093a854cc6efe383f1ae9f72cdd2c32542c (patch)
treeb955befa3ec7687dfaf6b268d5fec9835a14a624 /tt-rss.js
parent2e4afda7bfe7577e92ea90150bb5aee92c1aff0f (diff)
improve session expiry handling (redirect back to login form on rpc error code 6)
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js23
1 files changed, 20 insertions, 3 deletions
diff --git a/tt-rss.js b/tt-rss.js
index 0884ce8ae..bf673174f 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -73,10 +73,22 @@ function refetch_callback() {
return;
}
- var error_code = reply.getAttribute("error-code");
-
+ var error_code = false;
+ var error_msg = false;
+
+ if (reply.firstChild) {
+ error_code = reply.firstChild.getAttribute("error-code");
+ error_msg = reply.firstChild.getAttribute("error-msg");
+ }
+
+ if (!error_code) {
+ error_code = reply.getAttribute("error-code");
+ error_msg = reply.getAttribute("error-msg");
+ }
+
if (error_code && error_code != 0) {
- return fatalError(error_code, reply.getAttribute("error-msg"));
+ debug("refetch_callback: got error code " + error_code);
+ return fatalError(error_code, error_msg);
}
var counters = reply.firstChild;
@@ -535,6 +547,11 @@ function toggleDispRead() {
}
function parse_runtime_info(elem) {
+ if (!elem) {
+ debug("parse_runtime_info: elem is null, aborting");
+ return;
+ }
+
var param = elem.firstChild;
debug("parse_runtime_info: " + param);