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.
4 #ifndef SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_
5 #define SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_
9 #include "base/values.h"
10 #include "sync/base/sync_export.h"
11 #include "sync/internal_api/public/base/model_type.h"
15 enum SyncProtocolErrorType
{
19 // Birthday does not match that of the server.
22 // Server is busy. Try later.
25 // Clear user data is being currently executed by the server.
28 // Server cannot service the request now.
31 // Server does not wish the client to retry any more until the action has
35 // Indicates the datatypes have been migrated and the client should resync
36 // them to get the latest progress markers.
39 // Invalid Credential.
42 // An administrator disabled sync for this domain.
45 // Client told to stop syncing this device and roll back local data.
48 // Some of servers are busy. Try later with busy servers.
56 // Upgrade the client to latest version.
59 // Clear user data and setup sync again.
60 CLEAR_USER_DATA_AND_RESYNC
,
62 // Set the bit on the account to enable sync.
63 ENABLE_SYNC_ON_ACCOUNT
,
65 // Stop sync and restart sync.
66 STOP_AND_RESTART_SYNC
,
68 // Wipe this client of any sync data.
69 DISABLE_SYNC_ON_CLIENT
,
71 // Account is disabled by admin. Stop sync, clear prefs and show message on
72 // settings page that account is disabled.
73 STOP_SYNC_FOR_DISABLED_ACCOUNT
,
75 // Disable sync and roll back local model to pre-sync state.
76 DISABLE_SYNC_AND_ROLLBACK
,
78 // Generated by SyncRollbackManager to notify ProfileSyncService that
79 // rollback is finished.
82 // The default. No action.
86 struct SYNC_EXPORT SyncProtocolError
{
87 SyncProtocolErrorType error_type
;
88 std::string error_description
;
91 ModelTypeSet error_data_types
;
94 base::DictionaryValue
* ToValue() const;
97 SYNC_EXPORT
const char* GetSyncErrorTypeString(SyncProtocolErrorType type
);
98 SYNC_EXPORT
const char* GetClientActionString(ClientAction action
);
100 #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_