Log the error in console even if we think it's usage error

This commit is contained in:
minerobber 2019-05-27 04:37:04 +00:00
parent 523629d518
commit 96985ca2dd
1 changed files with 5 additions and 0 deletions

5
bot.py
View File

@ -39,6 +39,8 @@ class MinerbotPhoenix(teambot.Handler):
except:
print("On listener `{}`:".format(listener))
traceback.print_exc()
except SystemExit:
raise
except:
print("KERNAL PANIC")
traceback.print_exc()
@ -51,6 +53,9 @@ class MinerbotPhoenix(teambot.Handler):
plugin.cmds[cmd](self,channel,nick,*args)
except TypeError:
self.say(channel,"Usage: {}{} {}".format(self.prefix,cmd,plugin.help.get(cmd,"")))
errcls,err,tb = sys.exc_info()
print("On command `{}{} {}` by {}:".format(self.prefix,cmd," ".join(args),self.event.source))
traceback.print_exc()
except Exception as e:
errcls,err,tb = sys.exc_info()
self.say(channel,"ACCESS VIOLATION: "+traceback.format_exception_only(errcls,err)[0].strip())