Skip to content

Commit 5837bd0

Browse files
authored
Merge pull request #734 from dudash/master
catch unhandled OSError when serial port in use
2 parents 5487f7a + e2fe359 commit 5837bd0

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
@@ -1268,6 +1268,12 @@ def common():
12681268
message += " After running that command, log out and re-login for it to take effect.\n"
12691269
message += f"Error was:{ex}"
12701270
meshtastic.util.our_exit(message)
1271+
except OSError as ex:
1272+
message = f"OS Error:\n"
1273+
message += " The serial device couldn't be opened, it might be in use by another process.\n"
1274+
message += " Please close any applications or webpages that may be using the device and try again.\n"
1275+
message += f"\nOriginal error: {ex}"
1276+
meshtastic.util.our_exit(message)
12711277
if client.devPath is None:
12721278
try:
12731279
client = meshtastic.tcp_interface.TCPInterface(

0 commit comments

Comments
 (0)