Skip to content

Commit 9f1d8bf

Browse files
committed
Don't print error message when purposefully disconnecting from the socket
1 parent 821b593 commit 9f1d8bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/openspace/src/socketwrapper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async def _handle_receive(self):
4545
print("Error receiving data from OpenSpace. Connection closed.")
4646
break
4747
except ConnectionAbortedError as e:
48-
print(f"Connection exited with: {e}")
48+
if not self._disconnecting:
49+
# We don't need to print the message if we are already deliberately disconnecting
50+
print(f"Connection exited with: {e}")
4951
break
5052
except OSError as e:
5153
print(f"Connection exited with: {e}")
@@ -80,4 +82,4 @@ def disconnect(self):
8082

8183
self._disconnecting = True
8284
self._onDisconnect()
83-
self._client.close()
85+
self._client.close()

0 commit comments

Comments
 (0)