Skip to content

Commit

Permalink
fix: Also capture IOError/OSError in the reconnect loop
Browse files Browse the repository at this point in the history
We can get "Device not configured"/"File does not exist" errors
  • Loading branch information
2opremio committed Jul 18, 2024
1 parent e3e36d6 commit f48d363
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esp_idf_monitor/base/serial_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def run(self):
data = self.serial.read(self.serial.in_waiting or 1)
else:
raise serial.PortNotOpenError
except (serial.SerialException, IOError) as e:
except (serial.SerialException, IOError, OSError) as e:
data = b''
# self.serial.open() was successful before, therefore, this is an issue related to
# the disappearance of the device
Expand All @@ -85,7 +85,7 @@ def run(self):
self.open_serial(reset=self.reset)
self.reset = False
break # device connected
except serial.SerialException:
except (serial.SerialException, IOError, OSError):
if waited_time - last_dot_time > 0.5:
# print a dot every half second
last_dot_time = waited_time
Expand Down

0 comments on commit f48d363

Please sign in to comment.