diff --git a/adam_modbus/interface.py b/adam_modbus/interface.py index 2d982f0..cb6ee6c 100644 --- a/adam_modbus/interface.py +++ b/adam_modbus/interface.py @@ -41,8 +41,10 @@ async def _send_and_receive(self, message: str) -> str: loop.sock_recv(self.socket, 100), self.timeout ) except asyncio.TimeoutError: - raise AdamConnectionError("ADAM connection timed out (asyncio.TimeoutError))") - + raise AdamConnectionError( + "ADAM connection timed out (asyncio.TimeoutError))" + ) + except OSError: raise AdamConnectionError("ADAM connection failed (OSError))")