summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-07-10 00:23:18 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-07-23 11:57:16 +0200
commitc4d227e4d8fd8809fb3c3bded5540cc1e82746ef (patch)
tree8fa2f56f1deecbf08613054f6d1fe6dadb5af712
parent58af62f543bbb0e66247a37dae36698d9fa5d338 (diff)
downloadastra-c4d227e4d8fd8809fb3c3bded5540cc1e82746ef.tar.gz
astra-c4d227e4d8fd8809fb3c3bded5540cc1e82746ef.tar.bz2
astra-c4d227e4d8fd8809fb3c3bded5540cc1e82746ef.tar.xz
astra-c4d227e4d8fd8809fb3c3bded5540cc1e82746ef.zip
Show more useful information when a plugin raises an exception
-rw-r--r--python/astra/plugin.py9
1 files changed, 5 insertions, 4 deletions
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):