reason arg of panic() shouldn't be optional, detect current exception

This commit is contained in:
jesopo 2019-10-25 14:31:09 +01:00
parent b3f43a6721
commit 877287291a
2 changed files with 6 additions and 6 deletions

View file

@ -164,7 +164,7 @@ class Module(ModuleManager.BaseModule):
self.log.error(message)
self.bot.disconnect(server)
else:
self.bot.panic(reason=message)
self.bot.panic(message)
else:
self.log.warn("SASL failure for %s: %s" % (str(server), message))
self._end_sasl(server)

View file

@ -137,12 +137,12 @@ class Bot(object):
elif type == TriggerResult.Return:
return returned
def panic(self, reason=None):
callback = None
if not reason == None:
self.log.critical("panic() called: %s", [reason], exc_info=True)
def panic(self, reason):
exc_info = False
if any(sys.exc_info()):
exc_info = True
self.log.critical("panic() called: %s", [reason], exc_info=exc_info)
sys.exit(20)
def _module_lists(self):