Issue Number 232

Change state when an exception occurs in the register method. This should also be handled by the gui so that it stops blinking the protocol icon if such an exception occurs
cusax-fix
Emil Ivov 20 years ago
parent 21f1b0ffef
commit 3d99fcbe4d

@ -264,10 +264,28 @@ private void connectAndLogin(SecurityAuthority authority)
Roster.setDefaultSubscriptionMode(Roster.SUBSCRIPTION_MANUAL);
connection = new XMPPConnection(
try
{
connection = new XMPPConnection(
serverAddress,
Integer.parseInt(serverPort),
serviceName);
}
catch (XMPPException exc)
{
logger.error("Failed to establish a Jabber connection for "
+ getAccountID().getAccountUniqueID(), exc);
fireRegistrationStateChanged(
getRegistrationState()
, RegistrationState.CONNECTION_FAILED
, OperationFailedException.NETWORK_FAILURE
, null);
throw new OperationFailedException(
"Failed to establish a Jabber connection for "
+ getAccountID().getAccountUniqueID()
, OperationFailedException.NETWORK_FAILURE
, exc);
}
connection.addConnectionListener(
new JabberConnectionListener());

Loading…
Cancel
Save