Skip to content

Commit

Permalink
Wildcard exception catch from pyserial. (#2125)
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen authored Mar 28, 2024
1 parent 0803ff7 commit 326913d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pymodbus/client/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ def connect(self):
if self.strict:
self.socket.inter_byte_timeout = self.inter_byte_timeout
self.last_frame_end = None
except serial.SerialException as msg:
# except serial.SerialException as msg:
# pyserial raises undocumented exceptions like termios
except Exception as msg: # pylint: disable=broad-exception-caught
Log.error("{}", msg)
self.close()
return self.socket is not None
Expand Down

0 comments on commit 326913d

Please sign in to comment.