summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-07-06 09:59:22 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-07-06 10:06:48 -0700
commit8b75dd6e02d3ff18be6d7f28546b64e5ad9cf00f (patch)
treecdbaabd04acdc2f033cd41fd6062c73b4e2df3a4 /framework
parentbc407817e282990cce22d07ce44c20c94f5bc375 (diff)
framework: Re-raise uncaught exceptions from their original context
When an uncaught exception reaches the top level exception handler, and PIGLIT_DEBUG is true, then the exception will be re-raised. The problem is that currently the exception is re-raised as 'raise e', which raise the correct exception, but does so from the wrong context, making the back-trace completely useless. By re-raising by simply using the 'raise' keyword causes the exception to be passed on 'as-is', making the back trace useful for debugging. Trivial. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/exceptions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/framework/exceptions.py b/framework/exceptions.py
index 655a5dbcf..fdd1f1f88 100644
--- a/framework/exceptions.py
+++ b/framework/exceptions.py
@@ -57,7 +57,7 @@ def handler(func):
'BUG: {}'.format(str(e)),
file=sys.stderr)
if _DEBUG:
- raise e
+ raise
sys.exit(1)
except Exception as e: # pylint: disable=broad-except
print('Warning: A python exception that should have '
@@ -65,7 +65,7 @@ def handler(func):
'BUG: {}'.format(str(e)),
file=sys.stderr)
if _DEBUG:
- raise e
+ raise
sys.exit(1)
return _inner