Skip to content

Commit

Permalink
catch ConnectionException in read
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseklm committed Jul 10, 2024
1 parent 2118c34 commit 0c7281c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modbus_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read(self, table, address, count):
result = self.modbus_client.read_input_registers(address, count, unit=0x01)
else:
raise Exception('Invalid table')
except ConnectionResetError as e:
except (ConnectionResetError, ConnectionException) as e:
logging.error(f'read failed: {e}.')
self.reconnect()
continue
Expand Down

0 comments on commit 0c7281c

Please sign in to comment.