1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Throw exception to reduce call sites of notifyConnectionError()

in XMPPTCPConnection.
This commit is contained in:
Florian Schmaus 2019-03-07 09:49:16 +01:00
parent 7d2c3ac9f9
commit 5da6dea138

View file

@ -973,14 +973,13 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
@Override
protected void afterFeaturesReceived() throws NotConnectedException, InterruptedException {
protected void afterFeaturesReceived() throws NotConnectedException, InterruptedException, SecurityRequiredByServerException {
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
if (startTlsFeature != null) {
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled) {
SmackException smackException = new SecurityRequiredByServerException();
SecurityRequiredByServerException smackException = new SecurityRequiredByServerException();
tlsHandled.reportFailure(smackException);
notifyConnectionError(smackException);
return;
throw smackException;
}
if (config.getSecurityMode() != ConnectionConfiguration.SecurityMode.disabled) {