IMAP: improve error logging on network down

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@738 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-09-22 09:03:32 +00:00
parent a5d91980b1
commit 94ee1091a2
5 changed files with 13 additions and 4 deletions

View File

@ -163,7 +163,7 @@ public final class ExchangeSessionFactory {
BundleMessage message = new BundleMessage("EXCEPTION_CONNECT", exc.getClass().getName(), exc.getMessage());
if (errorSent) {
ExchangeSession.LOGGER.warn(message);
throw new NetworkDownException("EXCEPTION_DAVMAIL_CONFIGURATION");
throw new NetworkDownException("EXCEPTION_DAVMAIL_CONFIGURATION", message);
} else {
// Mark that an error has been sent so you only get one
// error in a row (not a repeating string of errors).

View File

@ -31,4 +31,13 @@ public class NetworkDownException extends DavMailException {
public NetworkDownException(String key) {
super(key);
}
/**
* Build a network down exception with the provided BundleMessage key.
* @param key message key
* @param message detailed message
*/
public NetworkDownException(String key, Object message) {
super(key, message);
}
}

View File

@ -470,7 +470,7 @@ public class ImapConnection extends AbstractConnection {
} catch (Exception e) {
DavGatewayTray.log(e);
try {
String message = (e.getMessage() == null) ? e.toString() : e.getMessage();
String message = ((e.getMessage() == null) ? e.toString() : e.getMessage()).replaceAll("\\n", " ");
if (commandId != null) {
sendClient(commandId + " BAD unable to handle request: " + message);
} else {

View File

@ -3,7 +3,7 @@ EXCEPTION_AUTHENTICATION_FAILED_PASSWORD_EXPIRED=Authentication failed: password
EXCEPTION_AUTHENTICATION_FAILED_RETRY=Authentication failed: invalid user or password, retry with domain\\user
EXCEPTION_AUTHENTICATION_FORM_NOT_FOUND=Authentication form not found at {0}
EXCEPTION_CONNECTION_FAILED=Unable to connect to OWA at {0}, status code {1}, check configuration
EXCEPTION_DAVMAIL_CONFIGURATION=DavMail configuration exception: \n{0}
EXCEPTION_DAVMAIL_CONFIGURATION=DavMail configuration exception:\n{0}
EXCEPTION_END_OF_STREAM=End of stream reached reading content
EXCEPTION_EVENT_NOT_FOUND=Calendar event not found
EXCEPTION_EXCHANGE_LOGIN_FAILED=Exchange login exception: {0}

View File

@ -3,7 +3,7 @@ EXCEPTION_AUTHENTICATION_FAILED_PASSWORD_EXPIRED=Echec d''authentification : mot
EXCEPTION_AUTHENTICATION_FAILED_RETRY=Echec d''authentification : identifiant ou mot de passe invalide, réessayer avec domaine\\utilisateur
EXCEPTION_AUTHENTICATION_FORM_NOT_FOUND=Formulaire d''authentification non trouvé à l''adresse {0}
EXCEPTION_CONNECTION_FAILED=Connection OWA à {0} impossible, code retour {1}, vérifier la configuration
EXCEPTION_DAVMAIL_CONFIGURATION=Erreur de configuration DavMail : \n{0}
EXCEPTION_DAVMAIL_CONFIGURATION=Erreur de configuration DavMail :\n{0}
EXCEPTION_END_OF_STREAM=Fin de flux âtteint pendant la lecture du contenu
EXCEPTION_EVENT_NOT_FOUND=Evènement non trouvé
EXCEPTION_EXCHANGE_LOGIN_FAILED=Exception lors de la connexion Exchange : {0}