git.graph-it.com
/
graphit
/
controlpi-wsclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42334c8
)
Catch TimeoutError.
author
Benjamin Braatz
<bb@bbraatz.eu>
Tue, 29 Mar 2022 19:10:29 +0000
(21:10 +0200)
committer
Benjamin Braatz
<bb@bbraatz.eu>
Tue, 29 Mar 2022 19:10:29 +0000
(21:10 +0200)
controlpi_plugins/wsclient.py
patch
|
blob
|
history
diff --git
a/controlpi_plugins/wsclient.py
b/controlpi_plugins/wsclient.py
index dd6dc9621dfe2dd75d2b7f29d0b90c1f3748a254..c833c39ee7832da4a042216dd5873ad94261dd70 100644
(file)
--- a/
controlpi_plugins/wsclient.py
+++ b/
controlpi_plugins/wsclient.py
@@
-1,5
+1,5
@@
import asyncio
-import
concurrent.future
s
+import
asyncio.exception
s
import fcntl
import json
import socket
@@
-195,8
+195,9
@@
class WSClient(BasePlugin):
await self.bus.send(Message(self.name,
{'event':
'connection closed'}))
- except (OSError, InvalidMessage, concurrent.futures.TimeoutError):
- pass
+ except (OSError, InvalidMessage,
+ asyncio.exceptions.TimeoutError) as e:
+ print(f"WSClient to {self.conf['url']}: {e}")
await asyncio.sleep(1)
async def _send(self, json_message: str) -> None: