Skip to content

Commit

Permalink
fix(loader): Could not open serial port message adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-kocka authored and radimkarnis committed Sep 27, 2023
1 parent 3f2dc6f commit 0d3a077
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions esptool/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,11 @@ def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False):
if isinstance(port, str):
try:
self._port = serial.serial_for_url(port)
except serial.serialutil.SerialException:
raise FatalError(f"Could not open {port}, the port doesn't exist")
except serial.serialutil.SerialException as e:
raise FatalError(
f"Could not open {port}, the port is busy or doesn't exist."
f"\n({e})\n"
)
else:
self._port = port
self._slip_reader = slip_reader(self._port, self.trace)
Expand Down

0 comments on commit 0d3a077

Please sign in to comment.