EWS: improve error message handling, log error description
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1931 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
321c1b0454
commit
29b99cafff
|
@ -79,6 +79,7 @@ public abstract class EWSMethod extends PostMethod {
|
||||||
|
|
||||||
protected List<Item> responseItems;
|
protected List<Item> responseItems;
|
||||||
protected String errorDetail;
|
protected String errorDetail;
|
||||||
|
protected String errorDescription;
|
||||||
protected Item item;
|
protected Item item;
|
||||||
|
|
||||||
protected SearchExpression searchExpression;
|
protected SearchExpression searchExpression;
|
||||||
|
@ -464,9 +465,9 @@ public abstract class EWSMethod extends PostMethod {
|
||||||
* attendee fullname
|
* attendee fullname
|
||||||
*/
|
*/
|
||||||
public String name;
|
public String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recurring event occurrence
|
* Recurring event occurrence
|
||||||
*/
|
*/
|
||||||
public static class Occurrence {
|
public static class Occurrence {
|
||||||
|
@ -682,7 +683,7 @@ public abstract class EWSMethod extends PostMethod {
|
||||||
&& !"ErrorItemNotFound".equals(errorDetail)
|
&& !"ErrorItemNotFound".equals(errorDetail)
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
throw new EWSException(errorDetail + "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
|
throw new EWSException(errorDetail +" "+((errorDescription!=null)?errorDescription:"")+ "\n request: " + new String(generateSoapEnvelope(), "UTF-8"));
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
throw new EWSException(e.getMessage());
|
throw new EWSException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -765,6 +766,11 @@ public abstract class EWSMethod extends PostMethod {
|
||||||
|
|
||||||
protected void handleErrors(XMLStreamReader reader) throws XMLStreamException {
|
protected void handleErrors(XMLStreamReader reader) throws XMLStreamException {
|
||||||
String result = handleTag(reader, "ResponseCode");
|
String result = handleTag(reader, "ResponseCode");
|
||||||
|
// store error description;
|
||||||
|
String messageText = handleTag(reader, "MessageText");
|
||||||
|
if (messageText != null) {
|
||||||
|
errorDescription = messageText;
|
||||||
|
}
|
||||||
if (errorDetail == null && result != null
|
if (errorDetail == null && result != null
|
||||||
&& !"NoError".equals(result)
|
&& !"NoError".equals(result)
|
||||||
&& !"ErrorNameResolutionMultipleResults".equals(result)
|
&& !"ErrorNameResolutionMultipleResults".equals(result)
|
||||||
|
|
Loading…
Reference in New Issue