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.log.error(message)
self.bot.disconnect(server) self.bot.disconnect(server)
else: else:
self.bot.panic(reason=message) self.bot.panic(message)
else: else:
self.log.warn("SASL failure for %s: %s" % (str(server), message)) self.log.warn("SASL failure for %s: %s" % (str(server), message))
self._end_sasl(server) self._end_sasl(server)

View file

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