]> jfr.im git - erebus.git/commitdiff
exception_hook - fix traceback to show last <limit> lines instead of first
authorJohn Runyon <redacted>
Thu, 2 Nov 2023 00:02:14 +0000 (18:02 -0600)
committerJohn Runyon <redacted>
Thu, 2 Nov 2023 00:02:14 +0000 (18:02 -0600)
modules/exception_hook.py

index 5c089ea1a65b77ec1d0141fa9641a8899b4736bf..28c4c545ca97f9e2118239243d09a877d56af713 100644 (file)
@@ -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)