Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(979)

Unified Diff: chrome/browser/sync/internal_api/includes/syncer_error.h

Issue 9113024: Add return values to SyncerCommand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move syncer_error.* to internal_api/includes Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/internal_api/includes/syncer_error.h
diff --git a/chrome/browser/sync/internal_api/includes/syncer_error.h b/chrome/browser/sync/internal_api/includes/syncer_error.h
new file mode 100644
index 0000000000000000000000000000000000000000..1f3c03b3b049612b64128221777e1e4f8f42fbeb
--- /dev/null
+++ b/chrome/browser/sync/internal_api/includes/syncer_error.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_
+#define CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_
+#pragma once
+
+namespace browser_sync {
+
+// This enum describes all the ways a SyncerCommand can fail.
+//
+// SyncerCommands do many different things, but they share a common function
+// signature. This enum, the return value for all SyncerCommands, must be able
+// to describe any possible failure for all SyncerComand.
+//
+// For convenience, functions which are invoked only by SyncerCommands may also
+// return a SyncerError. It saves us having to write a conversion function, and
+// it makes refactoring easier.
+enum SyncerError {
+ UNSET = 0, // Default value.
+ DIRECTORY_LOOKUP_FAILED, // Local directory lookup failure.
+
+ NETWORK_CONNECTION_UNAVAILABLE, // Connectivity failure.
+ NETWORK_IO_ERROR, // Response buffer read error.
+ SYNC_SERVER_ERROR, // Non auth HTTP error.
+ SYNC_AUTH_ERROR, // HTTP auth error.
+
+ // Based on values returned by server. Most are defined in sync.proto.
+ SERVER_RETURN_INVALID_CREDENTIAL,
+ SERVER_RETURN_UNKNOWN_ERROR,
+ SERVER_RETURN_THROTTLED,
+ SERVER_RETURN_TRANSIENT_ERROR,
+ SERVER_RETURN_MIGRATION_DONE,
+ SERVER_RETURN_CLEAR_PENDING,
+ SERVER_RETURN_NOT_MY_BIRTHDAY,
+ SERVER_RESPONSE_VALIDATION_FAILED,
+
+ SYNCER_OK
+};
+
+const char * GetSyncerErrorString(SyncerError);
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_
« no previous file with comments | « chrome/browser/sync/glue/ui_model_worker_unittest.cc ('k') | chrome/browser/sync/internal_api/includes/syncer_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698