X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/e33fc813275985611109b5731fd94a79fb12ba0f..56580e4e6b07ddb00b7046e77dc007626ce130fb:/modules/exception_hook.py diff --git a/modules/exception_hook.py b/modules/exception_hook.py index 5c089ea..78b51ba 100644 --- a/modules/exception_hook.py +++ b/modules/exception_hook.py @@ -1,5 +1,6 @@ # Erebus IRC bot - Author: Erebus Team # vim: fileencoding=utf-8 +# A basic exception hook. Sends exceptions to `[exception_hook] destination` in the config. # This file is released into the public domain; see http://unlicense.org/ # module info @@ -25,5 +26,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)