Simple Cache: Enable by default on Android developer builds
[chromium-blink-merge.git] / sync / protocol / sync_protocol_error.h
blobbe9232d21989f4dbd6469f7c1c41b002d21a2cb2
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_
7 #include <string>
9 #include "base/values.h"
10 #include "sync/base/sync_export.h"
11 #include "sync/internal_api/public/base/model_type.h"
13 namespace syncer{
15 enum SyncProtocolErrorType {
16 // Success case.
17 SYNC_SUCCESS,
19 // Birthday does not match that of the server.
20 NOT_MY_BIRTHDAY,
22 // Server is busy. Try later.
23 THROTTLED,
25 // Clear user data is being currently executed by the server.
26 CLEAR_PENDING,
28 // Server cannot service the request now.
29 TRANSIENT_ERROR,
31 // Server does not wish the client to retry any more until the action has
32 // been taken.
33 NON_RETRIABLE_ERROR,
35 // Indicates the datatypes have been migrated and the client should resync
36 // them to get the latest progress markers.
37 MIGRATION_DONE,
39 // Invalid Credential.
40 INVALID_CREDENTIAL,
42 // An administrator disabled sync for this domain.
43 DISABLED_BY_ADMIN,
45 // The default value.
46 UNKNOWN_ERROR
49 enum ClientAction {
50 // Upgrade the client to latest version.
51 UPGRADE_CLIENT,
53 // Clear user data and setup sync again.
54 CLEAR_USER_DATA_AND_RESYNC,
56 // Set the bit on the account to enable sync.
57 ENABLE_SYNC_ON_ACCOUNT,
59 // Stop sync and restart sync.
60 STOP_AND_RESTART_SYNC,
62 // Wipe this client of any sync data.
63 DISABLE_SYNC_ON_CLIENT,
65 // Account is disabled by admin. Stop sync, clear prefs and show message on
66 // settings page that account is disabled.
67 STOP_SYNC_FOR_DISABLED_ACCOUNT,
69 // The default. No action.
70 UNKNOWN_ACTION
73 struct SYNC_EXPORT SyncProtocolError {
74 SyncProtocolErrorType error_type;
75 std::string error_description;
76 std::string url;
77 ClientAction action;
78 ModelTypeSet error_data_types;
79 SyncProtocolError();
80 ~SyncProtocolError();
81 base::DictionaryValue* ToValue() const;
84 SYNC_EXPORT const char* GetSyncErrorTypeString(SyncProtocolErrorType type);
85 SYNC_EXPORT const char* GetClientActionString(ClientAction action);
86 } // namespace syncer
87 #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_