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>2016-05-17 14:01:03 +0300
committerimarom <imarom@cisco.com>2016-05-17 14:01:03 +0300
commit8b1d07ff4019df739a233cdcb812048ee44ae554 (patch)
tree3d7b32ab19701c29db15da9bb39aeb46607d0269 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_exceptions.py
parentf7ebbddbef19bf8bd362cfbe4772dfb65568285b (diff)
flush TX queue before sending done message to CP
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.py8
1 files changed, 7 insertions, 1 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 585af231..3c443ba6 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
@@ -1,5 +1,6 @@
import os
import sys
+import linecache
from .utils.text_opts import *
@@ -15,10 +16,15 @@ class STLError(Exception):
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
+ src_line = str(linecache.getline(fname, exc_tb.tb_lineno))
+
+
s = "\n******\n"
- s += "Error at {0}:{1}\n\n".format(format_text(fname, 'bold'), format_text(exc_tb.tb_lineno), 'bold')
+ s += "Error at {0}:{1} - '{2}'\n\n".format(format_text(fname, 'bold'), format_text(exc_tb.tb_lineno, 'bold'), format_text(src_line.strip(), 'bold'))
s += "specific error:\n\n{0}\n".format(format_text(self.msg, 'bold'))
+
+
return s
def brief (self):