Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 12162

Re: Frequent XmlPullParserException in Smack 3.2

$
0
0

You can't just ignore errors. Never do that, although java makes it tempting! It does fix nothing and makes things even worse.

If an exception happens when parsing the stream then something unforseen has happened. If you would just ignore the exception then you don't know the state of the stream, which makes the stream unuseable, because you don't now where to resume with parsing.

after the faulty stanza. This leaves the stream in a well defined state, because the stanza was just skipped.But I am working on SMACK-425 and my patch is nearly finished. It will allow you to define what should happen in case of an exception while parsing. As a special optional feature, it will also be possible to ignore the stanza that caused the exception and place the parser

It will also provide an callback that contains the raw stanza data that caused the exception. You can then investigate it and determine if the error was caused by an stanza that violates the XMPP/XEP specifications or because Smack isn't following the specifications.


Viewing all articles
Browse latest Browse all 12162

Trending Articles