1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-26 20:47:58 +01:00

SMACK-390 Log exception in parsing extensions of Presence. Valid Presence will still be returned with extensions missing.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13326 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2012-10-30 01:53:44 +00:00
parent e08c8afe44
commit fc3ec2ab8a

View file

@ -20,15 +20,6 @@
package org.jivesoftware.smack.util;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.packet.*;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.sasl.SASLMechanism.Failure;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.beans.PropertyDescriptor;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -39,6 +30,26 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.packet.Authentication;
import org.jivesoftware.smack.packet.Bind;
import org.jivesoftware.smack.packet.DefaultPacketExtension;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Registration;
import org.jivesoftware.smack.packet.RosterPacket;
import org.jivesoftware.smack.packet.StreamError;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.sasl.SASLMechanism.Failure;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* Utility class that helps to parse packets. Any parsing packets method that must be shared
* between many clients must be placed in this utility class.
@ -245,8 +256,12 @@ public class PacketParserUtils {
}
// Otherwise, it must be a packet extension.
else {
presence.addExtension(
PacketParserUtils.parsePacketExtension(elementName, namespace, parser));
try {
presence.addExtension(PacketParserUtils.parsePacketExtension(elementName, namespace, parser));
}
catch (Exception e) {
System.err.println("Failed to parse extension packet in Presence packet.");
}
}
}
else if (eventType == XmlPullParser.END_TAG) {