1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-12 18:52:21 -05:00

Do not always log stacktrace in handleNetworkDown

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1786 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-09-13 07:51:21 +00:00
parent e2ee71f10a
commit e8cfcb57ff

View File

@ -33,6 +33,7 @@ import org.apache.commons.httpclient.methods.GetMethod;
import java.io.IOException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@ -235,7 +236,10 @@ public final class ExchangeSessionFactory {
private static void handleNetworkDown(Exception exc) throws DavMailException {
if (!checkNetwork() || configChecked) {
ExchangeSession.LOGGER.warn(BundleMessage.formatLog("EXCEPTION_NETWORK_DOWN"));
ExchangeSession.LOGGER.debug(exc, exc);
// log full stack trace for unknown errors
if (!(exc instanceof UnknownHostException)) {
ExchangeSession.LOGGER.debug(exc, exc);
}
throw new NetworkDownException("EXCEPTION_NETWORK_DOWN");
} else {
BundleMessage message = new BundleMessage("EXCEPTION_CONNECT", exc.getClass().getName(), exc.getMessage());