From 8660c267e16c598427ea4a680b3f60bfc4305588 Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 5 May 2009 20:05:57 +0000 Subject: [PATCH] Catch unknown host on session login git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@553 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 5 +++++ src/java/davmailmessages_fr.properties | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index d1f51a51..36f97cfa 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -29,6 +29,7 @@ import javax.mail.internet.MimePart; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; +import java.net.UnknownHostException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -180,6 +181,10 @@ public class ExchangeSession { } catch (DavMailAuthenticationException exc) { LOGGER.error(exc.getLogMessage()); throw exc; + } catch (UnknownHostException exc) { + BundleMessage message = new BundleMessage("EXCEPTION_UNKNOWN_HOST", exc.getMessage()); + ExchangeSession.LOGGER.error(message); + throw new DavMailException("EXCEPTION_DAVMAIL_CONFIGURATION", message); } catch (IOException exc) { LOGGER.error(BundleMessage.formatLog("EXCEPTION_EXCHANGE_LOGIN_FAILED", exc)); throw new DavMailException("EXCEPTION_EXCHANGE_LOGIN_FAILED", exc); diff --git a/src/java/davmailmessages_fr.properties b/src/java/davmailmessages_fr.properties index 9087ad10..e99471f5 100644 --- a/src/java/davmailmessages_fr.properties +++ b/src/java/davmailmessages_fr.properties @@ -199,6 +199,6 @@ EXCEPTION_INVALID_CONTENT_TYPE=Type de contenu invalide : {0} EXCEPTION_INVALID_SEARCH_PARAMETERS=Paremètres de recherche invalides : {0} EXCEPTION_NETWORK_DOWN=Toutes les interfaces réseaux sont indisponibles ! EXCEPTION_DAVMAIL_CONFIGURATION=Erreur de configuration DavMail : \n{0} -EXCEPTION_UNKNOWN_HOST=Nom de serveur invalide {0} +EXCEPTION_UNKNOWN_HOST=Nom de serveur {0} invalide EXCEPTION_CONNECTION_FAILED=Connection OWA à {0} impossible, code retour {1}, vérifier la configuration EXCEPTION_EXCHANGE_LOGIN_FAILED=Exception lors de la connexion Exchange : {0} \ No newline at end of file