Commit b65bbfe4 authored by Allen Webb's avatar Allen Webb Committed by LUCI CQ

Include original traceback in _run_check_function.

This is a followup to CL:2797935 to make it easier to debug exceptions.

Bug: 1206782
Change-Id: Ibb649e94fd562919737de152e3203ca6b02b38ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2880843Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Allen Webb <allenwebb@google.com>
parent 4bd1522a
......@@ -1661,7 +1661,16 @@ class PresubmitExecuter(object):
if sink:
elapsed_time = time_time() - start_time
sink.report(function_name, rdb_wrapper.STATUS_FAIL, elapsed_time)
raise type(e)('Evaluation of %s failed: %s' % (function_name, e))
# TODO(crbug.com/953884): replace raise_from with native py3:
# raise .. from e
try:
from future.utils import raise_from
raise_from(type(e)('Evaluation of %s failed: %s' % (function_name, e)),
e)
except ImportError:
if self.verbose:
traceback.print_exc()
raise type(e)('Evaluation of %s failed: %s' % (function_name, e))
if sink:
elapsed_time = time_time() - start_time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment