mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 03:02:22 -05:00
EWS: allow autodiscover after authentication failure
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1540 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
1b2c7c720c
commit
e8a7e0b750
@ -148,13 +148,15 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
// check EWS access
|
||||
try {
|
||||
checkEndPointUrl("/ews/exchange.asmx");
|
||||
} catch (DavMailAuthenticationException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
try {
|
||||
// failover, try to retrieve EWS url from autodiscover
|
||||
checkEndPointUrl(getEwsUrlFromAutoDiscover());
|
||||
} catch (IOException e2) {
|
||||
// autodiscover failed and initial exception was authentication failure => throw original exception
|
||||
if (e instanceof DavMailAuthenticationException) {
|
||||
throw (DavMailAuthenticationException)e;
|
||||
}
|
||||
LOGGER.error(e2.getMessage());
|
||||
throw new DavMailAuthenticationException("EXCEPTION_EWS_NOT_AVAILABLE");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user