Mercurial > xib
comparison bridge.py @ 112:a817ad05dd1d
stop bridge on error instead of removing it
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Fri, 27 Nov 2009 23:18:54 +0100 |
parents | 59401ac0f47a |
children | 6daf0854aa9f |
comparison
equal
deleted
inserted
replaced
111:59401ac0f47a | 112:a817ad05dd1d |
---|---|
105 raise Exception('[Error] "'+self.bot.nickname+'" got "nicknametoolong" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) | 105 raise Exception('[Error] "'+self.bot.nickname+'" got "nicknametoolong" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) |
106 else: | 106 else: |
107 raise Exception('[Error] unknown error for "'+self.bot.nickname+'" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) | 107 raise Exception('[Error] unknown error for "'+self.bot.nickname+'" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) |
108 except: | 108 except: |
109 traceback.print_exc() | 109 traceback.print_exc() |
110 self.bot.error('[Error] failed to connect to the IRC chan of bridge "'+str(self)+'", removing bridge', send_to_admins=True) | 110 self.bot.error('[Error] failed to connect to the IRC chan of bridge "'+str(self)+'", stopping bridge', send_to_admins=True) |
111 self.bot.removeBridge(self) | 111 self.stop(message='failed to connect to the IRC chan') |
112 | 112 |
113 | 113 |
114 def _xmpp_join_callback(self, errors): | 114 def _xmpp_join_callback(self, errors): |
115 """Called by muc._xmpp_presence_handler""" | 115 """Called by muc._xmpp_presence_handler""" |
116 if len(errors) == 0: | 116 if len(errors) == 0: |
127 for error in errors: | 127 for error in errors: |
128 try: | 128 try: |
129 raise error | 129 raise error |
130 except: | 130 except: |
131 traceback.print_exc() | 131 traceback.print_exc() |
132 self.bot.error('[Error] failed to connect to the XMPP room of bridge "'+str(self)+'", removing bridge', send_to_admins=True) | 132 self.bot.error('[Error] failed to connect to the XMPP room of bridge "'+str(self)+'", stopping bridge', send_to_admins=True) |
133 self.bot.removeBridge(self) | 133 self.stop(message='failed to connect to the XMPP room') |
134 | 134 |
135 | 135 |
136 def addParticipant(self, from_protocol, nickname, real_jid=None): | 136 def addParticipant(self, from_protocol, nickname, real_jid=None): |
137 """Add a participant to the bridge.""" | 137 """Add a participant to the bridge.""" |
138 if (from_protocol == 'irc' and nickname == self.irc_connection.get_nickname()) or (from_protocol == 'xmpp' and nickname == self.xmpp_room.nickname): | 138 if (from_protocol == 'irc' and nickname == self.irc_connection.get_nickname()) or (from_protocol == 'xmpp' and nickname == self.xmpp_room.nickname): |