diff --git a/adam_modbus/interface.py b/adam_modbus/interface.py index 8078d8a..2d982f0 100644 --- a/adam_modbus/interface.py +++ b/adam_modbus/interface.py @@ -41,7 +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") + raise AdamConnectionError("ADAM connection timed out (asyncio.TimeoutError))") + + except OSError: + raise AdamConnectionError("ADAM connection failed (OSError))") response = adam_out.decode().strip() return response