From e6ae43cfdff9df499b82ff7f8a67f239cd74009e Mon Sep 17 00:00:00 2001 From: Gurmeen Bindra Date: Fri, 20 Sep 2013 14:25:37 +0100 Subject: Log data and exception message when error occurs This patch should provide more information when Stroke receives invalid xml or if an exception occurs. Test-information: deliberately caused an IllegalArg exception from an xmpp client and verified that I received the exception message in logs and the xml Change-Id: Id86b530f73f22c85ca36e54042ff7af74d55437d diff --git a/src/com/isode/stroke/parser/XMPPParser.java b/src/com/isode/stroke/parser/XMPPParser.java index 658ed9b..0e9b202 100644 --- a/src/com/isode/stroke/parser/XMPPParser.java +++ b/src/com/isode/stroke/parser/XMPPParser.java @@ -9,7 +9,6 @@ package com.isode.stroke.parser; import com.isode.stroke.elements.ProtocolHeader; -import com.isode.stroke.eventloop.EventLoop; import java.util.logging.Logger; @@ -40,6 +39,9 @@ public class XMPPParser implements XMLParserClient { } if (parseErrorOccurred_ || !xmlParseResult) { logger_.warning(String.format("When parsing, %b and %b", parseErrorOccurred_, xmlParseResult)); + if(data !=null) { + logger_.warning("xml that caused failure: " + data); + } } return xmlParseResult && !parseErrorOccurred_; } -- cgit v0.10.2-6-g49f6