1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 18:29:45 +02:00

Introduce SmackMessageException

This commit is contained in:
Florian Schmaus 2019-02-10 21:39:48 +01:00
parent b51a6c54e8
commit 7fce6b5a98
13 changed files with 76 additions and 46 deletions

View file

@ -911,13 +911,13 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
case "urn:ietf:params:xml:ns:xmpp-tls":
// TLS negotiation has failed. The server will close the connection
// TODO Parse failure stanza
throw new SmackException("TLS negotiation has failed");
throw new SmackException.SmackMessageException("TLS negotiation has failed");
case "http://jabber.org/protocol/compress":
// Stream compression has been denied. This is a recoverable
// situation. It is still possible to authenticate and
// use the connection but using an uncompressed connection
// TODO Parse failure stanza
compressSyncPoint.reportFailure(new SmackException(
compressSyncPoint.reportFailure(new SmackException.SmackMessageException(
"Could not establish compression"));
break;
case SaslStreamElements.NAMESPACE:
@ -957,7 +957,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
if (enabled.isResumeSet()) {
smSessionId = enabled.getId();
if (StringUtils.isNullOrEmpty(smSessionId)) {
SmackException xmppException = new SmackException("Stream Management 'enabled' element with resume attribute but without session id received");
SmackException xmppException = new SmackException.SmackMessageException("Stream Management 'enabled' element with resume attribute but without session id received");
smEnabledSyncPoint.reportFailure(xmppException);
throw xmppException;
}
@ -1069,7 +1069,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
case XmlPullParser.END_DOCUMENT:
// END_DOCUMENT only happens in an error case, as otherwise we would see a
// closing stream element before.
throw new SmackException(
throw new SmackException.SmackMessageException(
"Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element");
}
eventType = parser.next();