changeset 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 53f4d9aa2b52
files bridge.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bridge.py
+++ b/bridge.py
@@ -380,7 +380,11 @@ class Bridge:
 	
 	
 	def _say_on_irc(self, message):
-		self.irc_connection.privmsg(self.irc_room, message)
+		try:
+			self.irc_connection.privmsg(self.irc_room, message)
+		except ServerNotConnectedError:
+			bridges = self.bot.iter_bridges(irc_server=self.irc_server)
+			self.bot.restart_bridges_delayed(bridges, 0, say_levels.error, 'Lost bot IRC connection', protocol='irc')
 	
 	
 	def _say_on_xmpp(self, message):