mirror of
https://github.com/meshtastic/python.git
synced 2026-01-22 06:38:04 -05:00
Added except block to args.host to handle connection errors for the CLI.
This commit is contained in:
@@ -948,9 +948,14 @@ def common():
|
||||
if args.ble:
|
||||
client = BLEInterface(args.ble, debugOut=logfile, noProto=args.noproto)
|
||||
elif args.host:
|
||||
client = meshtastic.tcp_interface.TCPInterface(
|
||||
args.host, debugOut=logfile, noProto=args.noproto
|
||||
)
|
||||
try:
|
||||
client = meshtastic.tcp_interface.TCPInterface(
|
||||
args.host, debugOut=logfile, noProto=args.noproto
|
||||
)
|
||||
except Exception as ex:
|
||||
meshtastic.util.our_exit(
|
||||
f"Error connecting to {args.host}:{ex}", 1
|
||||
)
|
||||
else:
|
||||
try:
|
||||
client = meshtastic.serial_interface.SerialInterface(
|
||||
|
||||
Reference in New Issue
Block a user