Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connection exception to list of exceptions catpured in retries #2113

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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