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:
commit
6b7a8142c9
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue