Skip to content
Snippets Groups Projects
Commit 3a4b8d79 authored by Thomas Eichinger's avatar Thomas Eichinger
Browse files

Merge pull request #4323 from aabadie/master

Make pyterm fails gracefully if no port is available
parents 989743d6 0d9f14c8
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,12 @@ class SerCmd(cmd.Cmd): ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment