From: John Runyon Date: Thu, 2 Nov 2023 00:02:14 +0000 (-0600) Subject: exception_hook - fix traceback to show last lines instead of first X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/0778c0299dac4147424ccb4bc81b8cf92c9194b8 exception_hook - fix traceback to show last lines instead of first --- diff --git a/modules/exception_hook.py b/modules/exception_hook.py index 5c089ea..28c4c54 100644 --- a/modules/exception_hook.py +++ b/modules/exception_hook.py @@ -25,5 +25,5 @@ def got_exception(bot, exc, source, *args, **kwargs): dest = lib.parent.cfg.get('exception_hook', 'destination') if dest is not None: bot.msg(dest, '%s exception: %r %r' % (source, args, kwargs)) - for line in traceback.format_exc(limit=lib.parent.cfg.getint('exception_hook', 'limit', 5)).split("\n"): + for line in traceback.format_exc(limit=-lib.parent.cfg.getint('exception_hook', 'limit', 5)).split("\n"): bot.msg(dest, (' '*4) + line)