Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle runtime errors #1685

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion connector/systembridgeconnector/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ async def receive_message(self) -> dict | None:
if self._websocket is None:
return None

message = await self._websocket.receive()
try:
message = await self._websocket.receive()
except RuntimeError:
return None

if message.type == aiohttp.WSMsgType.ERROR:
raise ConnectionErrorException(self._websocket.exception())
Expand Down
5 changes: 4 additions & 1 deletion shared/systembridgeshared/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ async def receive_message(self) -> dict | None:
if self._websocket is None:
return None

message = await self._websocket.receive()
try:
message = await self._websocket.receive()
except RuntimeError:
return None

if message.type == aiohttp.WSMsgType.ERROR:
raise ConnectionErrorException(self._websocket.exception())
Expand Down