Skip to content

Commit

Permalink
Add Event object dump to hook error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed Nov 19, 2017
1 parent 973c01f commit b60e8bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/core/chan_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@


@hook.post_hook
def on_hook_end(error, message, launched_hook):
def on_hook_end(error, message, launched_hook, launched_event):
if error is not None and logchannel:
message("Error occurred in {}.{}".format(launched_hook.plugin.title, launched_hook.function_name), logchannel)

lines = traceback.format_exception(*error)
last_line = lines[-1]
message(last_line, logchannel)
url = web.paste('\n'.join(lines))
message(url, logchannel)
message("Traceback: " + url, logchannel)

event_data = launched_event.__dict__.items()
lines = ["{} = {}".format(k, v) for k, v in event_data]
url = web.paste('\n'.join(lines))
message("Event: " + url, logchannel)

0 comments on commit b60e8bc

Please sign in to comment.