1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +01:00

Merge pull request #110 from vfite/BOSH-ERROR

Add parsing non stream errors for BOSH
This commit is contained in:
Florian Schmaus 2017-02-27 13:34:02 +01:00 committed by GitHub
commit 6b7a8142c9

View file

@ -38,6 +38,7 @@ import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.Nonza;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.sasl.packet.SaslStreamElements.SASLFailure;
import org.jivesoftware.smack.sasl.packet.SaslStreamElements.Success;
import org.jivesoftware.smack.util.PacketParserUtils;
@ -529,7 +530,13 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
}
break;
case "error":
throw new StreamErrorException(PacketParserUtils.parseStreamError(parser));
//Some bosh error isn't stream error.
if ("urn:ietf:params:xml:ns:xmpp-streams".equals(parser.getNamespace(null))) {
throw new StreamErrorException(PacketParserUtils.parseStreamError(parser));
} else {
XMPPError.Builder builder = PacketParserUtils.parseError(parser);
throw new XMPPException.XMPPErrorException(null, builder.build());
}
}
break;
}