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
This commit is contained in:
Marc Blank 2010-03-20 10:02:43 -07:00
parent 22d29c67da
commit a3b7559404
1 changed files with 7 additions and 0 deletions

View File

@ -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;