From 3ecb723a0d855393e3bbc5adac9064fa6283bd14 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 5 Nov 2013 19:55:16 +0000 Subject: [PATCH] SMACK-463 Catch and log exceptions in packet listeners git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_2@13803 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/PacketReader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index e62d240e2..3aaad38c6 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -448,7 +448,12 @@ class PacketReader { public void run() { for (ListenerWrapper listenerWrapper : connection.recvListeners.values()) { - listenerWrapper.notifyListener(packet); + try { + listenerWrapper.notifyListener(packet); + } catch (Exception e) { + System.err.println("Exception in packet listener: " + e); + e.printStackTrace(); + } } } }