changeset 268:7602a0898d19

catch irclib.UnknownChannel in Bridge.stop and Bridge.soft_restart Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Tue, 23 Mar 2010 00:42:36 +0100
parents f861a7038ad3
children abef394fded5
files bridge.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bridge.py
+++ b/bridge.py
@@ -408,7 +408,10 @@ class Bridge:
 		
 		# Leave
 		if isinstance(self.irc_connection, irclib.ServerConnection) and isinstance(self.xmpp_room, xmpp.muc):
-			self.irc_connection.part(self.irc_room, message=message)
+			try:
+				self.irc_connection.part(self.irc_room, message=message)
+			except irclib.UnknownChannel:
+				pass
 			self.xmpp_room.leave(message=message)
 		else:
 			self.stop()
@@ -432,7 +435,10 @@ class Bridge:
 			if self.irc_connection.used_by < 1:
 				self.irc_connection.close(message)
 			else:
-				self.irc_connection.part(self.irc_room, message=message)
+				try:
+					self.irc_connection.part(self.irc_room, message=message)
+				except irclib.UnknownChannel:
+					pass
 			self.irc_connection = None
 		
 		# Leave the MUC