use of org.jivesoftware.smack.parsing.ParsingExceptionCallback in project Smack by igniterealtime.
the class AbstractXMPPConnection method parseAndProcessStanza.
protected void parseAndProcessStanza(XmlPullParser parser) throws Exception {
ParserUtils.assertAtStartTag(parser);
int parserDepth = parser.getDepth();
Stanza stanza = null;
try {
stanza = PacketParserUtils.parseStanza(parser);
} catch (Exception e) {
CharSequence content = PacketParserUtils.parseContentDepth(parser, parserDepth);
UnparseableStanza message = new UnparseableStanza(content, e);
ParsingExceptionCallback callback = getParsingExceptionCallback();
if (callback != null) {
callback.handleUnparsableStanza(message);
}
}
ParserUtils.assertAtEndTag(parser);
if (stanza != null) {
processStanza(stanza);
}
}
Aggregations