From a3b75594040a97fb40f1fdac55e5fd7a87ba5e6e Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sat, 20 Mar 2010 10:02:43 -0700 Subject: [PATCH] Handle other validation errors more appropriately * Previously, we handled the error case for security related errors * Add code to fail on ANY error, and in particular to recognize the error in which an OWA server address is used instead of an EAS server address Bug: 2494110 Change-Id: Iab7df56e82f5ff73b1f58d386ec6f844db26a312 --- src/com/android/exchange/EasSyncService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index 0a4a936bb..4aee01309 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -356,6 +356,13 @@ public class EasSyncService extends AbstractSyncService { // If not, send the unsupported Exception (the account won't be created) throw new MessagingException( MessagingException.SECURITY_POLICIES_UNSUPPORTED); + } else if (code == HttpStatus.SC_NOT_FOUND) { + // We get a 404 from OWA addresses (which are NOT EAS addresses) + throw new MessagingException(MessagingException.PROTOCOL_VERSION_UNSUPPORTED); + } else if (code != HttpStatus.SC_OK) { + // Fail generically with anything other than success + userLog("Unexpected response for FolderSync: ", code); + throw new MessagingException(MessagingException.UNSPECIFIED_EXCEPTION); } userLog("Validation successful"); return;