From c4d227e4d8fd8809fb3c3bded5540cc1e82746ef Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 10 Jul 2015 00:23:18 +0200 Subject: Show more useful information when a plugin raises an exception --- python/astra/plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/astra') diff --git a/python/astra/plugin.py b/python/astra/plugin.py index be5c155..f8fc3bd 100644 --- a/python/astra/plugin.py +++ b/python/astra/plugin.py @@ -27,6 +27,7 @@ from . import plugin_c as p from . import log import inspect +import traceback class base(object): @@ -64,15 +65,15 @@ class base(object): args = [optDict[k] for k in req] kwargs = dict((k,optDict[k]) for k in opt if k in optDict) self.initialize(cfg, *args, **kwargs) - except Exception as e: - log.error(str(e)) + except Exception: + log.error(traceback.format_exc().replace("%","%%")) raise def astra_run(self, its): try: self.run(its) - except Exception as e: - log.error(str(e)) + except Exception: + log.error(traceback.format_exc().replace("%","%%")) raise def register(name, className): -- cgit v1.2.3