From 9bed38d12c5a9cd6ae18f0e5ccdc482341a1f46b Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Fri, 26 Aug 2016 15:29:54 +0800 Subject: [PATCH] Correct castellan reraising of exception When an exception was caught and rethrown, it should call 'raise' without any arguments because it shows the place where an exception occured initially instead of place where the exception re-raised. Change-Id: I121c004082d37a5af1671060e3bdf6655ebeffc2 --- castellan/common/exception.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/castellan/common/exception.py b/castellan/common/exception.py index cccea91c..f45db7a4 100644 --- a/castellan/common/exception.py +++ b/castellan/common/exception.py @@ -43,9 +43,9 @@ class CastellanException(Exception): message_arg = self.message try: self.message = message_arg % 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 pass