Spark 1786 (#210)

* Spark-1786

* Spark-1786
This commit is contained in:
Speedy
2016-09-01 14:06:07 -05:00
committed by wroot
parent 3a79c3ccd0
commit 10613daeff
3 changed files with 20 additions and 24 deletions

View File

@ -1105,42 +1105,35 @@ public class LoginDialog {
}
catch (Exception xee) {
errorMessage = SparkRes.getString(SparkRes.UNRECOVERABLE_ERROR);
hasErrors = true;
if (!loginDialog.isVisible()) {
loginDialog.setVisible(true);
}
if (xee instanceof XMPPException.XMPPErrorException) {
XMPPException.XMPPErrorException xe = (XMPPException.XMPPErrorException)xee;
switch ( xe.getXMPPError().getCondition() )
{
case conflict:
errorMessage = Res.getString("label.conflict.error");
break;
if (xee.getMessage().contains("not-authorized")) {
errorMessage = Res.getString("message.invalid.username.password");
case not_authorized:
errorMessage = Res.getString("message.invalid.username.password");
break;
} else if (xee.getMessage().contains("failed because java.net.UnknownHostException:") | xee.getMessage().contains("Network is unreachable")) {
errorMessage = Res.getString("message.server.unavailable");
case remote_server_not_found:
errorMessage = Res.getString("message.server.unavailable");
break;
} else if (xee.getMessage().contains("Hostname verification of certificate failed")) {
errorMessage = Res.getString("message.hostname.cert.verification.failed");
ReconnectionManager.getInstanceFor(connection).disableAutomaticReconnection();
case remote_server_timeout:
errorMessage = Res.getString("message.server.unavailable");
break;
} else if (xee.getMessage().contains("unable to find valid certification path to requested target")) {
errorMessage = Res.getString("message.cert.verification.failed");
ReconnectionManager.getInstanceFor(connection).disableAutomaticReconnection();
default:
errorMessage = Res.getString("message.unrecoverable.error");
break;
}
}
} else if (xee.getMessage().contains("XMPPError: conflict")) {
errorMessage = Res.getString("label.conflict.error");
} else errorMessage = Res.getString("message.unrecoverable.error");
// Log Error
Log.warning("Exception in Login:", xee);
}
}
if (hasErrors) {

View File

@ -157,7 +157,7 @@ ERROR_INVALID_WORKGROUP = The workgroup is not valid. Please use a valid workgro
ERROR_DIALOG_TITLE = Login Error
INVALID_USERNAME_PASSWORD = Invalid username or password.
SERVER_UNAVAILABLE = Can't connect to server: invalid name or server not reachable.
UNRECOVERABLE_ERROR = Invalid username or password.
UNRECOVERABLE_ERROR = Unknown connection error. Please review the logs for more information.
#Chat Window Images
ALERT = images/alert.png

View File

@ -657,6 +657,7 @@ message.buzz.sent = Requested users attention
message.calling = Calling {0}
message.came.online = {0} is online at {1}
message.cannot.add.contact.to.shared.group = You cannot add new contacts to a shared group
message.cert.verification.failed = Unable to verify certificate
message.chat.session.ended = Chat session has ended on {0}
message.click.to.open = Click to open
message.client.information = Client information for {0}
@ -724,6 +725,7 @@ message.gateway.password.error = Password needs to be supplied
message.gateway.nickname.error = Nickname needs to be supplied
message.general.error = You have lost your connection to the server due to {0}
message.generic.reconnect.message = You have lost your connection to the server, to login again, click on the reconnect button below
message.hostname.cert.verification.failed = Hostname certificate verification failed
message.idle.for = Idle for {0}
message.image.too.large = This image is too large to use, please specify an image 16k or smaller
message.invalid.jabber.id = Not a valid Jabber ID
@ -827,7 +829,7 @@ message.unable.to.retrieve.last.activity = Unable to determine last activity for
message.unable.to.save.password = Unable to change password, please contact your server admin
message.unable.to.send.file = You were unable to send the file to {0}
message.unable.to.use.hostname.as.resource = Unable to use hostname as resource
message.unrecoverable.error = Invalid username or password
message.unrecoverable.error = Unknown connection error. Please review the logs for more information
message.update.room.list = Update room list
message.updating.cancelled = Updating has been canceled
message.user.banned = {0} has been banned from this room. Reason: {1}
@ -1122,3 +1124,4 @@ action.viewlog=View Log
dialog.confirm.to.reveal.visibility.title=Are you sure?
dialog.confirm.to.reveal.visibility.msg=If you are going to proceed your invisibility will be revealed
dialog.confirm.close.all.conferences.if.invisible.msg=If you want to proceed all conference room will be closed