mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
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:
parent
a5d91980b1
commit
94ee1091a2
@ -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).
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user