Fix error handling for non existent serial ports
This commit is contained in:
parent
d6bf061c65
commit
9ce43d542c
1 changed files with 2 additions and 3 deletions
|
@ -73,10 +73,9 @@ class MattchBox(Controller):
|
|||
try:
|
||||
self.ser.open()
|
||||
self.logger.log.info("Connected to serial port {}".format(port))
|
||||
except serial.SerialException as e:
|
||||
except (FileNotFoundError, serial.SerialException) as e:
|
||||
self.logger.log.error(
|
||||
"Could not open serial port" + str(port),
|
||||
e
|
||||
"Could not open serial port {}:\n{}".format(port, e)
|
||||
)
|
||||
self._disconnected()
|
||||
self.ser = None
|
||||
|
|
Loading…
Reference in a new issue