Caldav: improve 404 error handling

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1240 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-20 22:35:54 +00:00
parent 03927f53dc
commit 534c129660
1 changed files with 9 additions and 4 deletions

View File

@ -24,6 +24,7 @@ import davmail.DavGateway;
import davmail.Settings;
import davmail.exception.DavMailAuthenticationException;
import davmail.exception.DavMailException;
import davmail.exception.HttpNotFoundException;
import davmail.exchange.ExchangeSession;
import davmail.exchange.ExchangeSessionFactory;
import davmail.exchange.ICSBufferedReader;
@ -991,8 +992,12 @@ public class CaldavConnection extends AbstractConnection {
if (message == null) {
message = e.toString();
}
if (e instanceof HttpNotFoundException) {
sendErr(HttpStatus.SC_NOT_FOUND, message);
} else {
sendErr(HttpStatus.SC_SERVICE_UNAVAILABLE, message);
}
}
/**
* Send 400 bad response for unsupported request.