From ffb4740fe73005b81fd830dfedd2f6b2ab4e0994 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 28 Sep 2011 09:53:45 +0000 Subject: [PATCH] EWS: improve error logging on invalid character git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1801 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ews/EWSMethod.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/java/davmail/exchange/ews/EWSMethod.java b/src/java/davmail/exchange/ews/EWSMethod.java index 68472796..2765654d 100644 --- a/src/java/davmail/exchange/ews/EWSMethod.java +++ b/src/java/davmail/exchange/ews/EWSMethod.java @@ -1006,7 +1006,7 @@ public abstract class EWSMethod extends PostMethod { protected void processResponseStream(InputStream inputStream) { responseItems = new ArrayList(); - XMLStreamReader reader; + XMLStreamReader reader = null; try { inputStream = new FilterInputStream(inputStream) { int totalCount; @@ -1043,9 +1043,15 @@ public abstract class EWSMethod extends PostMethod { handleCustom(reader); } } - } catch (XMLStreamException e) { LOGGER.error("Error while parsing soap response: " + e, e); + if (reader != null) { + try { + LOGGER.error("Current text: " + reader.getText()); + } catch (IllegalStateException ise) { + LOGGER.error(e+" "+e.getMessage()); + } + } } if (errorDetail != null) { LOGGER.debug(errorDetail);