1 // Copyright (c) 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/internal_api/public/base/model_type.h"
14 enum SyncProtocolErrorType
{
18 // Birthday does not match that of the server.
21 // Server is busy. Try later.
24 // Clear user data is being currently executed by the server.
27 // Server cannot service the request now.
30 // Server does not wish the client to retry any more until the action has
34 // Indicates the datatypes have been migrated and the client should resync
35 // them to get the latest progress markers.
38 // Invalid Credential.
46 // Upgrade the client to latest version.
49 // Clear user data and setup sync again.
50 CLEAR_USER_DATA_AND_RESYNC
,
52 // Set the bit on the account to enable sync.
53 ENABLE_SYNC_ON_ACCOUNT
,
55 // Stop sync and restart sync.
56 STOP_AND_RESTART_SYNC
,
58 // Wipe this client of any sync data.
59 DISABLE_SYNC_ON_CLIENT
,
61 // The default. No action.
65 struct SyncProtocolError
{
66 SyncProtocolErrorType error_type
;
67 std::string error_description
;
70 ModelTypeSet error_data_types
;
73 DictionaryValue
* ToValue() const;
76 const char* GetSyncErrorTypeString(SyncProtocolErrorType type
);
77 const char* GetClientActionString(ClientAction action
);
79 #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_