Update error handler to ignore non-errors

This commit is contained in:
Vgr E.Barry 2015-08-10 09:09:14 -04:00
parent 0dd3c08862
commit d58a9249ab

View File

@ -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)