pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.16k stars 889 forks source link

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

Closed johnmiko closed 3 months ago

johnmiko commented 3 months ago

It's possible when using a Modbus TCP connection that the connection is unexpectedly closed while writing to a register. This raises a ConnectionException that is not caught in the existing catch statement.

Note: The retry is done in the retry_on_empty catch

It's possible that this type of exception should not be caught, and should instead raise an error as the connection should not close unexpectedly. If I misunderstood, feel free to decline the pull request