From: Yaroslav Brustinov Date: Wed, 28 Sep 2016 11:22:31 +0000 (+0300) Subject: trex-console: add print of Python error in case of error loading profile in TUI X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=eef160385f07aa94e1dfc67b481a659465410d61;p=trex.git trex-console: add print of Python error in case of error loading profile in TUI --- diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 3fe31d4d..b5ae0f94 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -2867,10 +2867,14 @@ class STLClient(object): self.add_streams(profile.get_streams(), ports = port) except STLError as e: - msg = format_text("\nError while loading profile '{0}'\n".format(opts.file[0]), 'bold') - self.logger.log(msg) + error = 'Unknown error.' + for line in e.brief().split('\n'): + if line: + error = line + msg = format_text("\nError loading profile '{0}'".format(opts.file[0]), 'bold') + self.logger.log(msg + '\n') self.logger.log(e.brief() + "\n") - return RC_ERR(msg) + return RC_ERR("%s: %s" % (msg, error)) if opts.dry: