From d58a9249abad4cadcc07e6b838e5065c408060b0 Mon Sep 17 00:00:00 2001 From: "Vgr E.Barry" Date: Mon, 10 Aug 2015 09:09:14 -0400 Subject: [PATCH] Update error handler to ignore non-errors --- src/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/__init__.py b/src/__init__.py index 6a5f6d7..a57fb66 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -139,6 +139,13 @@ class ErrorHandler(io.TextIOWrapper): def flush(self): self.buffer.flush() + import builtins + + exc = self.data[-1].partition(":")[0] + + if not issubclass(getattr(builtins, exc, BaseException), Exception): + return # not an actual exception + msg = "An error has occurred and has been logged." if not botconfig.PASTEBIN_ERRORS or botconfig.CHANNEL != botconfig.DEV_CHANNEL: self.cli.msg(botconfig.CHANNEL, msg)