Collect (parser) Exceptions and unparseable stanzas. Provide a callback method so that the user is notified about them if he wants to

Description

We currently catch some exceptions, typically parsing related ones, and simply log them, sometimes with printSackTrace(). This is not really desirable:

  • In case of parser exceptions we don't get a chance to inspect the packet that caused the exception

  • printStackTrace polluts the log (especially on Android it causes ugly side-effects in the log)

Ideally we would have a callback, where the user can register, that is invoked when such an exception is thrown. Also if there are stanzas without providers received such a callback could be invoked (see ). The user can then decide what do do with it.

So, to sum up:

  • Provide a callback for parsing exceptions

  • Provide a callback for stanzas without a provider/handler

  • Provide a callback instead of calling printStackTrace()

References

Environment

None

Activity

Robin Collier 
October 5, 2013 at 11:14 PM

Changes made based on review.

Robin Collier 
September 15, 2013 at 1:02 PM

Couple of things I would like to see addressed. http://fisheye.igniterealtime.org/cru/SMACK-4

Florian Schmaus 
March 6, 2013 at 6:30 PM

Instead of creating a dummy IQ packet ('UnparsedResultIQ'), a callback that contains the unparsed data would be invoked

Florian Schmaus 
March 6, 2013 at 6:29 PM

instead of simply printing an log message we would invoke a callback

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created March 6, 2013 at 6:27 PM
Updated August 17, 2014 at 1:11 PM
Resolved October 5, 2013 at 11:14 PM