summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2017-02-06 13:20:41 +0200
committerimarom <imarom@cisco.com>2017-02-06 13:21:44 +0200
commitbcea02625fb2ce43ee81e56320941dfd8ff10327 (patch)
tree1f237b927b4a3a75a53befca0e68ae765cd05b04 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
parent1570aea16299122399e14c7c281fe3d4259e63a7 (diff)
added example for functional tests using start_capture/stop_capture APIs
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
index 2ca92cb8..fa8163b8 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
@@ -17,14 +17,15 @@ class STLError(Exception):
def __str__ (self):
- fname = os.path.split(self.tb[-2][0])[1]
- lineno = self.tb[-2][1]
- func = self.tb[-2][2]
- src = self.tb[-2][3]
-
- s = "\n******\n"
- s += "Error at {0}:{1} - '{2}'\n\n".format(format_text(fname, 'bold'), format_text(lineno, 'bold'), format_text(src.strip(), 'bold'))
- s += "specific error:\n\n{0}\n".format(format_text(self.msg, 'bold'))
+ s = format_text("\n******\n", 'bold')
+ s += format_text('\nSummary error report:\n\n', 'underline')
+ s += format_text(self.msg + '\n', 'bold')
+
+ s += format_text("\nFull error report:\n\n", 'underline')
+
+ for line in reversed(self.tb):
+ fname, lineno, func, src = os.path.split(line[0])[1], line[1], line[2], line[3]
+ s += " {:}:{:<20} - '{}'\n".format(format_text(fname, 'bold'), format_text(lineno, 'bold'), format_text(src.strip(), 'bold'))
return s