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).
Commit
b6de299bb716b3ea49ee233e147522df272f45812b99a688d9bcfdabbdb29457
Parent
b12d69d9f4686ce…
1 file changed
+4
-1
+4
-1
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -497,11 +497,14 @@ | ||
| 497 | 497 | poll.running = true; |
| 498 | 498 | if(isFirstCall) Chat.ajaxStart(); |
| 499 | 499 | var p = fetch("chat-poll?name=" + Chat.mxMsg); |
| 500 | 500 | p.then(x=>x.json()) |
| 501 | 501 | .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. */ | |
| 503 | 506 | .finally(function(x){ |
| 504 | 507 | if(isFirstCall) Chat.ajaxEnd(); |
| 505 | 508 | poll.running=false; |
| 506 | 509 | }); |
| 507 | 510 | } |
| 508 | 511 |
| --- 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 |