Skip to content

Commit

Permalink
provide more information when a plugin barfs an exception
Browse files Browse the repository at this point in the history
This is still not very useful because the stack trace is in the
context of the re-raise by futures.Future, not within the thread
where it was originally raised.  I'm not sure whether it's possible
to fix this without using a different thread handling mechanism.

See also issue saschpe#6.
  • Loading branch information
Adam Spiers committed May 20, 2013
1 parent c811156 commit 33c2386
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rapport/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import concurrent.futures as futures
else:
import futures
import traceback

import jinja2

Expand Down Expand Up @@ -91,7 +92,8 @@ def create_report(plugins, timeframe):
except jinja2.TemplateSyntaxError as e:
print >>sys.stderr, "Syntax error in plugin {0} at {1} line {2}: {3}".format(plugin, e.name, e.lineno, e.message)
except Exception as e:
print >>sys.stderr, "Failed plugin {0}:{1}: {2}!".format(plugin, plugin.alias, e)
print >>sys.stderr, "Failed plugin {0}:{1}:".format(plugin, plugin.alias)
print >>sys.stderr, traceback.format_exc()

results_dict = {"login": rapport.config.get("user", "login"),
"date": report_date_string,
Expand Down

0 comments on commit 33c2386

Please sign in to comment.