Browse Source

hide errors which stem form request which do not perform a handshake

Rodja Trappe 2 years ago
parent
commit
f9a62d3312
1 changed files with 4 additions and 1 deletions
  1. 4 1
      nicegui/functions/timer.py

+ 4 - 1
nicegui/functions/timer.py

@@ -1,4 +1,5 @@
 import asyncio
+import contextlib
 import time
 import traceback
 from typing import Callable
@@ -82,7 +83,9 @@ class Timer:
         See https://github.com/zauberzeug/nicegui/issues/206 for details.
         '''
         if not self.slot.parent.client.shared:
-            await self.slot.parent.client.connected()
+            # ignore served pages which do not reconnect to backend (eg. monitoring requests, scrapers etc.)
+            with contextlib.suppress(TimeoutError):
+                await self.slot.parent.client.connected()
 
     def cleanup(self) -> None:
         self.slot = None