summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorGurmeen Bindra <gurmeen.bindra@isode.com>2013-09-20 13:25:37 (GMT)
committerGurmeen Bindra <gurmeen.bindra@isode.com>2013-10-25 08:26:16 (GMT)
commite6ae43cfdff9df499b82ff7f8a67f239cd74009e (patch)
treed65a84eba8229f1e0fa0bcde342400e56a0f6adb /src/com
parent0da10958ce02b8d7ae8a5d9b5a7ec249203b2441 (diff)
downloadstroke-e6ae43cfdff9df499b82ff7f8a67f239cd74009e.zip
stroke-e6ae43cfdff9df499b82ff7f8a67f239cd74009e.tar.bz2
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
Diffstat (limited to 'src/com')
-rw-r--r--src/com/isode/stroke/parser/XMPPParser.java4
1 files changed, 3 insertions, 1 deletions
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_;
}