Mercurial > xib
comparison bridge.py @ 263:73d6e284c18d
handle irclib.ServerNotConnectedError in Bridge._say_on_irc
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 22 Mar 2010 18:41:57 +0100 |
parents | db77ef37ff2c |
children | 48cf498b9620 |
comparison
equal
deleted
inserted
replaced
262:db77ef37ff2c | 263:73d6e284c18d |
---|---|
378 elif on_protocol == 'irc': | 378 elif on_protocol == 'irc': |
379 self._say_on_irc(message) | 379 self._say_on_irc(message) |
380 | 380 |
381 | 381 |
382 def _say_on_irc(self, message): | 382 def _say_on_irc(self, message): |
383 self.irc_connection.privmsg(self.irc_room, message) | 383 try: |
384 self.irc_connection.privmsg(self.irc_room, message) | |
385 except ServerNotConnectedError: | |
386 bridges = self.bot.iter_bridges(irc_server=self.irc_server) | |
387 self.bot.restart_bridges_delayed(bridges, 0, say_levels.error, 'Lost bot IRC connection', protocol='irc') | |
384 | 388 |
385 | 389 |
386 def _say_on_xmpp(self, message): | 390 def _say_on_xmpp(self, message): |
387 self.xmpp_room.say(message) | 391 self.xmpp_room.say(message) |
388 | 392 |