From 6ad7625ae20a5a99c91cef61f19f026a56dc5cf3 Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Fri, 2 Dec 2016 10:25:24 +0800 Subject: [PATCH] Correct 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: I3667715dc1bb4d8d56ad7a8c660c61fa676cdf9f --- monasca_notification/plugins/jira_notifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monasca_notification/plugins/jira_notifier.py b/monasca_notification/plugins/jira_notifier.py index 6dd278f..9801db6 100644 --- a/monasca_notification/plugins/jira_notifier.py +++ b/monasca_notification/plugins/jira_notifier.py @@ -84,9 +84,9 @@ class JiraNotifier(AbstractNotifier): try: with open(self._config.get("custom_formatter")) as f: jira_fields_format = yaml.load(f) - except Exception as e: + except Exception: self._log.exception("Unable to read custom_formatter file. Check file location") - raise e + raise # Remove the top element jira_fields_format = jira_fields_format["jira_format"]