fix(loader): Could not open serial port message adjusted

This commit is contained in:
Jakub Kocka
2023-09-20 12:57:20 +02:00
committed by Radim Karniš
parent 3f2dc6f486
commit 0d3a077d47

View File

@@ -301,8 +301,11 @@ class ESPLoader(object):
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)