mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
Use SmackWrappedException where sensible
This commit is contained in:
parent
b7d6edcd1e
commit
bb759a136e
2 changed files with 6 additions and 5 deletions
|
@ -900,7 +900,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
openStream();
|
||||
}
|
||||
catch (Exception e) {
|
||||
SmackException smackException = new SmackException(e);
|
||||
SmackException.SmackWrappedException smackException = new SmackException.SmackWrappedException(e);
|
||||
tlsHandled.reportFailure(smackException);
|
||||
throw e;
|
||||
}
|
||||
|
@ -985,7 +985,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
if (!smEnabledSyncPoint.requestSent()) {
|
||||
throw new IllegalStateException("Failed element received but SM was not previously enabled");
|
||||
}
|
||||
smEnabledSyncPoint.reportFailure(new SmackException(xmppException));
|
||||
smEnabledSyncPoint.reportFailure(new SmackException.SmackWrappedException(xmppException));
|
||||
// Report success for last lastFeaturesReceived so that in case a
|
||||
// failed resumption, we can continue with normal resource binding.
|
||||
// See text of XEP-198 5. below Example 11.
|
||||
|
|
|
@ -1000,7 +1000,8 @@ public class XmppNioTcpConnection extends AbstractXmppNioConnection {
|
|||
|
||||
@Override
|
||||
protected TransitionIntoResult transitionInto(WalkStateGraphContext walkStateGraphContext)
|
||||
throws SmackException, FailedNonzaException, IOException, InterruptedException {
|
||||
throws SmackWrappedException, FailedNonzaException, IOException, InterruptedException,
|
||||
ConnectionUnexpectedTerminatedException, NoResponseException, NotConnectedException {
|
||||
sendAndWaitForResponse(StartTls.INSTANCE, TlsProceed.class, TlsFailure.class);
|
||||
|
||||
SmackTlsContext smackTlsContext;
|
||||
|
@ -1008,7 +1009,7 @@ public class XmppNioTcpConnection extends AbstractXmppNioConnection {
|
|||
smackTlsContext = getSmackTlsContext();
|
||||
} catch (KeyManagementException | UnrecoverableKeyException | NoSuchAlgorithmException
|
||||
| CertificateException | KeyStoreException | NoSuchProviderException e) {
|
||||
throw new SmackException(e);
|
||||
throw new SmackWrappedException(e);
|
||||
}
|
||||
|
||||
tlsState = new TlsState(smackTlsContext);
|
||||
|
@ -1028,7 +1029,7 @@ public class XmppNioTcpConnection extends AbstractXmppNioConnection {
|
|||
try {
|
||||
tlsState.waitForHandshakeFinished();
|
||||
} catch (CertificateException e) {
|
||||
throw new SmackException(e);
|
||||
throw new SmackWrappedException(e);
|
||||
}
|
||||
|
||||
newStreamOpenWaitForFeaturesSequence("stream features after TLS established");
|
||||
|
|
Loading…
Reference in a new issue