show Error Dialog with full error message instead of popup when Stream Error arrives. see #4660
This commit is contained in:
parent
16fa30a1e7
commit
0724a4ffea
|
@ -625,12 +625,17 @@ class Connection(ConnectionHandlers):
|
||||||
if not self.retrycount and self.connected != 0:
|
if not self.retrycount and self.connected != 0:
|
||||||
self.disconnect(on_purpose = True)
|
self.disconnect(on_purpose = True)
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
sectxt = ''
|
pritxt = _('Could not connect to "%s"') % self._hostname
|
||||||
|
sectxt = _('Check your connection or try again later.')
|
||||||
if self.streamError:
|
if self.streamError:
|
||||||
sectxt = _('Server replied: %s\n') % self.streamError
|
# show error dialog
|
||||||
self.dispatch('CONNECTION_LOST',
|
key = common.xmpp.NS_XMPP_STREAMS + ' ' + self.streamError
|
||||||
(_('Could not connect to "%s"') % self._hostname,
|
if key in common.xmpp.ERRORS:
|
||||||
_('%sCheck your connection or try again later.') % sectxt))
|
sectxt2 = _('Server replied: %s') % common.xmpp.ERRORS[key][2]
|
||||||
|
self.dispatch('ERROR', (pritxt, '%s\n%s' % (sectxt2, sectxt)))
|
||||||
|
return
|
||||||
|
# show popup
|
||||||
|
self.dispatch('CONNECTION_LOST', (pritxt, sectxt))
|
||||||
|
|
||||||
def on_proxy_failure(self, reason):
|
def on_proxy_failure(self, reason):
|
||||||
log.error('Connection to proxy failed: %s' % reason)
|
log.error('Connection to proxy failed: %s' % reason)
|
||||||
|
|
Loading…
Reference in New Issue