From dad4d5e5c2c5d1722619c68a856eb987ffb59634 Mon Sep 17 00:00:00 2001 From: Alon Kosowsky-Sachs Date: Wed, 29 Nov 2023 08:14:20 -0500 Subject: [PATCH] error names --- adam_modbus/interface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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))")