Skip to content

Commit b41baea

Browse files
authored
Merge pull request #477 from TimothyHarder/hardertimothy/issue-366
Issue #366 TCP connection error handling
2 parents bbc4589 + b11edac commit b41baea

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

meshtastic/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,14 @@ def common():
948948
if args.ble:
949949
client = BLEInterface(args.ble, debugOut=logfile, noProto=args.noproto)
950950
elif args.host:
951-
client = meshtastic.tcp_interface.TCPInterface(
952-
args.host, debugOut=logfile, noProto=args.noproto
953-
)
951+
try:
952+
client = meshtastic.tcp_interface.TCPInterface(
953+
args.host, debugOut=logfile, noProto=args.noproto
954+
)
955+
except Exception as ex:
956+
meshtastic.util.our_exit(
957+
f"Error connecting to {args.host}:{ex}", 1
958+
)
954959
else:
955960
try:
956961
client = meshtastic.serial_interface.SerialInterface(

0 commit comments

Comments
 (0)