Fossil SCM

chat poll again uses "quiet" error handling to avoid posting toast error messages when it times out (which it does every 10 minutes or so when idle).

stephan 2020-12-24 22:21 trunk
Commit b6de299bb716b3ea49ee233e147522df272f45812b99a688d9bcfdabbdb29457
1 file changed +4 -1
+4 -1
--- src/chat.js
+++ src/chat.js
@@ -497,11 +497,14 @@
497497
poll.running = true;
498498
if(isFirstCall) Chat.ajaxStart();
499499
var p = fetch("chat-poll?name=" + Chat.mxMsg);
500500
p.then(x=>x.json())
501501
.then(y=>newcontent(y))
502
- .catch(e=>Chat.reportError(e))
502
+ .catch(e=>console.error(e))
503
+ /* ^^^ we don't use Chat.reportError(e) here b/c the polling
504
+ fails exepectedly when it times out, but is then immediately
505
+ resumed, and reportError() produces a loud error message. */
503506
.finally(function(x){
504507
if(isFirstCall) Chat.ajaxEnd();
505508
poll.running=false;
506509
});
507510
}
508511
--- src/chat.js
+++ src/chat.js
@@ -497,11 +497,14 @@
497 poll.running = true;
498 if(isFirstCall) Chat.ajaxStart();
499 var p = fetch("chat-poll?name=" + Chat.mxMsg);
500 p.then(x=>x.json())
501 .then(y=>newcontent(y))
502 .catch(e=>Chat.reportError(e))
 
 
 
503 .finally(function(x){
504 if(isFirstCall) Chat.ajaxEnd();
505 poll.running=false;
506 });
507 }
508
--- src/chat.js
+++ src/chat.js
@@ -497,11 +497,14 @@
497 poll.running = true;
498 if(isFirstCall) Chat.ajaxStart();
499 var p = fetch("chat-poll?name=" + Chat.mxMsg);
500 p.then(x=>x.json())
501 .then(y=>newcontent(y))
502 .catch(e=>console.error(e))
503 /* ^^^ we don't use Chat.reportError(e) here b/c the polling
504 fails exepectedly when it times out, but is then immediately
505 resumed, and reportError() produces a loud error message. */
506 .finally(function(x){
507 if(isFirstCall) Chat.ajaxEnd();
508 poll.running=false;
509 });
510 }
511

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button