From 2eb2c83b2bb6aecd3e3a759721f5be957d3fce76 Mon Sep 17 00:00:00 2001 From: Brian Koopman Date: Fri, 4 Oct 2024 12:34:50 -0400 Subject: [PATCH] Raise if unable to reset at start of send --- socs/tcp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/socs/tcp.py b/socs/tcp.py index facba1913..da5ac8e5a 100644 --- a/socs/tcp.py +++ b/socs/tcp.py @@ -78,9 +78,10 @@ def send(self, msg): """ if self.comm is None: - print("Connection not established. Unable to send command.") + print("Connection not established.") self._reset() - return + if self.comm is None: + raise ConnectionError("Unable to establish connection.") try: self.comm.sendall(msg)