Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: trace_inputs.py

Issue 11154011: Improve exception handling. (Closed) Base URL: https://git.chromium.org/chromium/tools/swarm_client.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « run_test_cases.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trace_inputs.py
diff --git a/trace_inputs.py b/trace_inputs.py
index 4e8df22757b15ef1672c50b6711df71ff068531c..f001099cccbba054796c009ee96d6d737183bca7 100755
--- a/trace_inputs.py
+++ b/trace_inputs.py
@@ -1502,8 +1502,8 @@ class Strace(ApiBase):
for line in open(pidfile, 'rb'):
context.on_line(pid, line)
result['results'] = context.to_results()
- except TracingFailure, e:
- result['exception'] = e
+ except TracingFailure:
+ result['exception'] = sys.exc_info()
out.append(result)
return out
@@ -3042,7 +3042,10 @@ def load_trace(logfile, root_dir, api, blacklist):
assert len(data) == 1, 'More than one trace was detected!'
if 'exception' in data[0]:
# It got an exception, raise it.
- raise data[0]['exception']
+ raise \
csharp 2012/10/15 15:38:28 Would it be better to use brackets, or does raise
M-A Ruel 2012/10/15 15:40:25 It didn't work when I used (). :/ It's really an a
+ data[0]['exception'][0], \
+ data[0]['exception'][1], \
+ data[0]['exception'][2]
results = data[0]['results']
if root_dir:
results = results.strip_root(root_dir)
@@ -3114,8 +3117,10 @@ def CMDread(args):
output_as_json = []
for item in data:
if 'exception' in item:
+ # Do not abort the other traces.
print >> sys.stderr, (
- 'Trace %s: Got an exception: %s' % (item['trace'], item['exception']))
+ 'Trace %s: Got an exception: %s' % (
+ item['trace'], item['exception'][1]))
continue
results = item['results']
if options.root_dir:
« no previous file with comments | « run_test_cases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698