Catch exceptions in dying callbacks so all callbacks get a chance to die.

This commit is contained in:
Jeremy Fincher 2004-02-03 07:11:32 +00:00
parent 393a5b48f3
commit 717ee92e41

View File

@ -667,8 +667,11 @@ class Irc(IrcCommandDispatcher):
"""Makes the Irc object die. Dead.""" """Makes the Irc object die. Dead."""
log.info('Irc object for %s dying.' % self.server) log.info('Irc object for %s dying.' % self.server)
if self in world.ircs: if self in world.ircs:
for callback in self.callbacks: for cb in self.callbacks:
callback.die() try:
cb.die()
except Exception, e:
log.exception('Uncaught exception in %s.die:', cb.name())
world.ircs.remove(self) world.ircs.remove(self)
else: else:
log.warning('Irc object killed twice.') log.warning('Irc object killed twice.')