core (xmpp), stdui (profile_manager), bridge, frontends: raise an exception if the XMPP connection failed instead of sending a signal
This commit is contained in:
parent
f719875f0b
commit
244a33d2c7
1 changed files with 32 additions and 41 deletions
|
|
@ -83,26 +83,26 @@ class SatXMPPClient(client.XMPPClient):
|
|||
|
||||
def initializationFailed(self, reason):
|
||||
log.error(_("ERROR: XMPP connection failed for profile '%(profile)s': %(reason)s" % {'profile': self.profile, 'reason': reason}))
|
||||
self.host_app.bridge.connectionError("AUTH_ERROR", self.profile)
|
||||
self.conn_deferred.errback(reason.value)
|
||||
try:
|
||||
client.XMPPClient.initializationFailed(self, reason)
|
||||
except:
|
||||
# we already send an error signal, no need to raise an exception
|
||||
# we already chained an errback, no need to raise an exception
|
||||
pass
|
||||
self.conn_deferred.errback()
|
||||
|
||||
def isConnected(self):
|
||||
return self.__connected
|
||||
|
||||
def connectionLost(self, connector, unused_reason):
|
||||
self.__connected = False
|
||||
log.info(_("********** [%s] DISCONNECTED **********") % self.profile)
|
||||
try:
|
||||
self.keep_alife.stop()
|
||||
except AttributeError:
|
||||
log.debug(_("No keep_alife"))
|
||||
self.host_app.bridge.disconnected(self.profile) # we send the signal to the clients
|
||||
self.host_app.purgeClient(self.profile) # and we remove references to this client
|
||||
if self.__connected:
|
||||
log.info(_("********** [%s] DISCONNECTED **********") % self.profile)
|
||||
self.host_app.bridge.disconnected(self.profile) # we send the signal to the clients
|
||||
self.host_app.purgeClient(self.profile) # and we remove references to this client
|
||||
self.__connected = False
|
||||
|
||||
|
||||
class SatMessageProtocol(xmppim.MessageProtocol):
|
||||
|
|
|
|||
Loading…
Reference in a new issue