summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorSergey Vilgelm <svilgelm@mirantis.com>2013-06-25 14:42:15 +0400
committerSergey Vilgelm <svilgelm@mirantis.com>2013-06-25 14:55:09 +0400
commit31325752e1d202c95f65b8af0e656b283043f1cd (patch)
tree194bf8abe8537cdf589d5b4841361714e2a49907 /openstack/common
parentbc10b7aeada4ea66e85e10b94b5c219e3c8d2e77 (diff)
downloadoslo-31325752e1d202c95f65b8af0e656b283043f1cd.tar.gz
oslo-31325752e1d202c95f65b8af0e656b283043f1cd.tar.xz
oslo-31325752e1d202c95f65b8af0e656b283043f1cd.zip
Do not raise NEW exceptions
Raising NEW exception is bad practice, because we lose TraceBack. So all places like: except SomeException as e: raise e should be replaced by except SomeException: raise If we are doing some other actions before reraising we should store information about exception then do all actions and then reraise it. This is caused by eventlet bug. It lost information about exception if it switch threads. fixes bug 1191730 Change-Id: I7bce659591c4c3e4bc41e12d7d8390128c30e2e4
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/exception.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openstack/common/exception.py b/openstack/common/exception.py
index cdf40f3..f6c8463 100644
--- a/openstack/common/exception.py
+++ b/openstack/common/exception.py
@@ -122,9 +122,9 @@ class OpenstackException(Exception):
try:
self._error_string = self.message % kwargs
- except Exception as e:
+ except Exception:
if _FATAL_EXCEPTION_FORMAT_ERRORS:
- raise e
+ raise
else:
# at least get the core message out if something happened
self._error_string = self.message