self._client, self.name)
if translated_message is not None:
json_message = json.dumps(translated_message)
- await self._websocket.send(json_message)
+ try:
+ await self._websocket.send(json_message)
+ except Exception as e:
+ print(f"WSClient '{self.name}':"
+ f" Exception in websocket send: {e}")
async def run(self) -> None:
"""Connect to wsserver and process messages from it."""
assert isinstance(json_message, str)
await self._send(json_message)
except Exception as e:
- print(f"WSClient '{self.name}': Exception in connection: {e}")
+ print(f"WSClient '{self.name}':"
+ f" Exception in websocket receive loop: {e}")
self._websocket = None
print(f"WSClient '{self.name}': Connection closed"
f" to {self.conf['url']}.")
setuptools.setup(
name="controlpi-wsclient",
- version="0.3.4",
+ version="0.3.5",
author="Graph-IT GmbH",
author_email="info@graph-it.com",
description="ControlPi Plugin for Websocket Clients",