changeset 274:fa5375057658

fixed an UnboundLocalError in Bridge._xmpp_join_callback Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Tue, 13 Apr 2010 11:46:02 +0200
parents 8d01d0597950
children 09a5bde70919
files bridge.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bridge.py
+++ b/bridge.py
@@ -125,14 +125,16 @@ class Bridge:
 		else:
 			self.stopped = True
 			self.say(say_levels.error, 'failed to connect to the XMPP room, leaving ...', on_xmpp=False)
+			trace = ''
 			for error in errors:
 				try:
 					raise error
 				except xmpp.muc.RemoteServerNotFound:
 					self._RemoteServerNotFound_handler()
+					return
 				except:
-					trace = traceback.format_exc().splitlines()[-1]
-			self.bot.error(say_levels.error, 'failed to connect to the XMPP room of bridge "'+str(self)+'", stopping bridge\n'+trace, send_to_admins=True)
+					trace += '\n'+traceback.format_exc().splitlines()[-1]
+			self.bot.error(say_levels.error, 'failed to connect to the XMPP room of bridge "'+str(self)+'", stopping bridge'+trace, send_to_admins=True)
 			self.stop(message='Failed to connect to the XMPP room, stopping bridge', log=False)