Remove reporting for some types of exceptions

gtask_related_email
Alex Baker 5 years ago
parent f898547a54
commit e87b7dedb9

@ -17,6 +17,8 @@ import at.bitfire.dav4jvm.Response;
import at.bitfire.dav4jvm.Response.HrefRelation;
import at.bitfire.dav4jvm.exception.DavException;
import at.bitfire.dav4jvm.exception.HttpException;
import at.bitfire.dav4jvm.exception.ServiceUnavailableException;
import at.bitfire.dav4jvm.exception.UnauthorizedException;
import at.bitfire.dav4jvm.property.CalendarData;
import at.bitfire.dav4jvm.property.DisplayName;
import at.bitfire.dav4jvm.property.GetCTag;
@ -118,13 +120,20 @@ public class CaldavSynchronizer {
}
try {
synchronize(account);
} catch (SocketTimeoutException | SSLException | ConnectException | UnknownHostException e) {
} catch (SocketTimeoutException
| SSLException
| ConnectException
| UnknownHostException
| UnauthorizedException
| ServiceUnavailableException e) {
setError(account, e.getMessage());
} catch (IOException | DavException e) {
setError(account, e.getMessage());
if (!(e instanceof HttpException) || ((HttpException) e).getCode() < 500) {
tracker.reportException(e);
}
}
}
private void synchronize(CaldavAccount account) throws IOException, DavException {
CaldavClient caldavClient = client.forAccount(account);

Loading…
Cancel
Save