Skip to content

Commit

Permalink
Add connection exception to list of exceptions catpured in retries (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmiko authored and janiversen committed Apr 7, 2024
1 parent 9a4308c commit 007568f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from threading import RLock

from pymodbus.exceptions import (
ConnectionException,
InvalidMessageReceivedException,
ModbusIOException,
)
Expand Down Expand Up @@ -325,7 +326,7 @@ def _transact(self, packet, response_length, full=False, broadcast=False):
result = self._recv(response_length, full)
# result2 = self._recv(response_length, full)
Log.debug("RECV: {}", result, ":hex")
except (OSError, ModbusIOException, InvalidMessageReceivedException) as msg:
except (OSError, ModbusIOException, InvalidMessageReceivedException, ConnectionException) as msg:
self.client.close()
Log.debug("Transaction failed. ({}) ", msg)
last_exception = msg
Expand Down

0 comments on commit 007568f

Please sign in to comment.