Don't assume email was sent successfully when HTTP status is not 200

Also add some logging.

b/11350433

Change-Id: Ib3eea6f7b349ea25deff0f93c4768aaf1c33af53
diff --git a/src/com/android/exchange/service/EasOutboxSyncHandler.java b/src/com/android/exchange/service/EasOutboxSyncHandler.java
index b1f5d4d..47f9aca 100644
--- a/src/com/android/exchange/service/EasOutboxSyncHandler.java
+++ b/src/com/android/exchange/service/EasOutboxSyncHandler.java
@@ -26,6 +26,7 @@
 import com.android.exchange.adapter.Parser.EmptyStreamException;
 import com.android.exchange.adapter.Serializer;
 import com.android.exchange.adapter.Tags;
+import com.android.mail.utils.LogUtils;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpStatus;
@@ -496,9 +497,16 @@
                 return sendOneMessage(message, null);
             } else {
                 if (resp.isAuthError()) {
+                    LogUtils.d(LogUtils.TAG, "Got auth error from server during outbox sync");
                     return false; // TODO: Handle SyncStatus.FAILURE_LOGIN;
                 } else if (resp.isProvisionError()) {
+                    LogUtils.d(LogUtils.TAG, "Got provision error from server during outbox sync.");
                     return false; // TODO: Handle SyncStatus.FAILURE_SECURITY;
+                } else {
+                    // TODO: Handle some other error
+                    LogUtils.d(LogUtils.TAG,
+                            "Got other HTTP error from server during outbox sync: %d", code);
+                    return false;
                 }
             }
         } finally {