Mercurial > xib
comparison bridge.py @ 176:bca516d04bdb
attach traceback to error message when joining IRC or XMPP fails
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 08 Feb 2010 18:54:54 +0100 |
parents | 8378da7844f2 |
children | f6c6708c6c0e |
comparison
equal
deleted
inserted
replaced
175:8378da7844f2 | 176:bca516d04bdb |
---|---|
100 elif error == 'nicknametoolong': | 100 elif error == 'nicknametoolong': |
101 raise Exception('[Error] "'+self.bot.nickname+'" got "nicknametoolong" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) | 101 raise Exception('[Error] "'+self.bot.nickname+'" got "nicknametoolong" on bridge "'+str(self)+'", limit seems to be '+str(arguments[0])) |
102 else: | 102 else: |
103 raise Exception('[Error] unknown error for "'+self.bot.nickname+'" on bridge "'+str(self)+'"') | 103 raise Exception('[Error] unknown error for "'+self.bot.nickname+'" on bridge "'+str(self)+'"') |
104 except: | 104 except: |
105 traceback.print_exc() | 105 trace = traceback.format_exc() |
106 self.bot.error('[Error] failed to connect to the IRC chan of bridge "'+str(self)+'", stopping bridge', send_to_admins=True) | 106 self.bot.error('[Error] failed to connect to the IRC chan of bridge "'+str(self)+'", stopping bridge\n'+trace, send_to_admins=True) |
107 self.stop(message='failed to connect to the IRC chan') | 107 self.stop(message='failed to connect to the IRC chan') |
108 | 108 |
109 | 109 |
110 def _RemoteServerNotFound_handler(self): | 110 def _RemoteServerNotFound_handler(self): |
111 server = xmpp.protocol.JID(self.xmpp_room_jid).getDomain() | 111 server = xmpp.protocol.JID(self.xmpp_room_jid).getDomain() |
131 try: | 131 try: |
132 raise error | 132 raise error |
133 except xmpp.muc.RemoteServerNotFound: | 133 except xmpp.muc.RemoteServerNotFound: |
134 self._RemoteServerNotFound_handler() | 134 self._RemoteServerNotFound_handler() |
135 except: | 135 except: |
136 traceback.print_exc() | 136 trace = traceback.format_exc() |
137 self.bot.error('[Error] failed to connect to the XMPP room of bridge "'+str(self)+'", stopping bridge', send_to_admins=True) | 137 self.bot.error('[Error] failed to connect to the XMPP room of bridge "'+str(self)+'", stopping bridge\n'+trace, send_to_admins=True) |
138 self.stop(message='failed to connect to the XMPP room') | 138 self.stop(message='failed to connect to the XMPP room') |
139 | 139 |
140 | 140 |
141 def addParticipant(self, from_protocol, nickname, real_jid=None, irc_id=None): | 141 def addParticipant(self, from_protocol, nickname, real_jid=None, irc_id=None): |
142 """Add a participant to the bridge.""" | 142 """Add a participant to the bridge.""" |