Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / sync / internal_api / public / util / syncer_error.h
blob05ad96339c2f0c97e69ed5aedd9b311086743f1e
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_
6 #define SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_
8 #include "sync/base/sync_export.h"
10 namespace syncer {
12 // This enum describes all the possible results of a sync cycle.
13 enum SYNC_EXPORT_PRIVATE SyncerError {
14 UNSET = 0, // Default value.
15 CANNOT_DO_WORK, // A model worker could not process a work item.
17 NETWORK_CONNECTION_UNAVAILABLE, // Connectivity failure.
18 NETWORK_IO_ERROR, // Response buffer read error.
19 SYNC_SERVER_ERROR, // Non auth HTTP error.
20 SYNC_AUTH_ERROR, // HTTP auth error.
22 // Based on values returned by server. Most are defined in sync.proto.
23 SERVER_RETURN_INVALID_CREDENTIAL,
24 SERVER_RETURN_UNKNOWN_ERROR,
25 SERVER_RETURN_THROTTLED,
26 SERVER_RETURN_TRANSIENT_ERROR,
27 SERVER_RETURN_MIGRATION_DONE,
28 SERVER_RETURN_CLEAR_PENDING,
29 SERVER_RETURN_NOT_MY_BIRTHDAY,
30 SERVER_RETURN_CONFLICT,
31 SERVER_RESPONSE_VALIDATION_FAILED,
32 SERVER_RETURN_DISABLED_BY_ADMIN,
33 SERVER_RETURN_USER_ROLLBACK,
35 // A datatype decided the sync cycle needed to be performed again.
36 DATATYPE_TRIGGERED_RETRY,
38 SERVER_MORE_TO_DOWNLOAD,
40 SYNCER_OK
43 SYNC_EXPORT const char* GetSyncerErrorString(SyncerError);
45 // Helper to check that |error| is set to something (not UNSET) and is not
46 // SYNCER_OK.
47 bool SyncerErrorIsError(SyncerError error);
49 } // namespace syncer
51 #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_