Skip to content

Commit e2fe359

Browse files
committed
catch unhandled OSError when serial port in use
1 parent 6ec506f commit e2fe359

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

meshtastic/__main__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,12 @@ def common():
12551255
message += " After running that command, log out and re-login for it to take effect.\n"
12561256
message += f"Error was:{ex}"
12571257
meshtastic.util.our_exit(message)
1258+
except OSError as ex:
1259+
message = f"OS Error:\n"
1260+
message += " The serial device couldn't be opened, it might be in use by another process.\n"
1261+
message += " Please close any applications or webpages that may be using the device and try again.\n"
1262+
message += f"\nOriginal error: {ex}"
1263+
meshtastic.util.our_exit(message)
12581264
if client.devPath is None:
12591265
try:
12601266
client = meshtastic.tcp_interface.TCPInterface(

0 commit comments

Comments
 (0)