make pyterm nicely fails if no port is available
This commit is contained in:
parent
3fc71ef694
commit
0d9f14c848
7
dist/tools/pyterm/pyterm
vendored
7
dist/tools/pyterm/pyterm
vendored
@ -210,7 +210,12 @@ class SerCmd(cmd.Cmd):
|
|||||||
# otherwise go for the serial port
|
# otherwise go for the serial port
|
||||||
elif self.port:
|
elif self.port:
|
||||||
self.logger.info("Connect to serial port %s" % self.port)
|
self.logger.info("Connect to serial port %s" % self.port)
|
||||||
self.serial_connect()
|
try:
|
||||||
|
self.serial_connect()
|
||||||
|
except OSError as e:
|
||||||
|
self.logger.error("Cannot connect to serial port {}: {}"
|
||||||
|
.format(self.port, e.strerror))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# wait until connection is established and fire startup
|
# wait until connection is established and fire startup
|
||||||
# commands to the node
|
# commands to the node
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user