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."""
log.info('Irc object for %s dying.' % self.server)
if self in world.ircs:
for callback in self.callbacks:
callback.die()
for cb in self.callbacks:
try:
cb.die()
except Exception, e:
log.exception('Uncaught exception in %s.die:', cb.name())
world.ircs.remove(self)
else:
log.warning('Irc object killed twice.')