OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | |
5 #define CHROME_BROWSER_SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | |
6 #pragma once | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/values.h" | |
11 #include "chrome/browser/sync/syncable/model_type.h" | |
12 | |
13 namespace browser_sync{ | |
14 | |
15 enum SyncProtocolErrorType { | |
16 // Success case. | |
17 SYNC_SUCCESS, | |
18 | |
19 // Birthday does not match that of the server. | |
20 NOT_MY_BIRTHDAY, | |
21 | |
22 // Server is busy. Try later. | |
23 THROTTLED, | |
24 | |
25 // Clear user data is being currently executed by the server. | |
26 CLEAR_PENDING, | |
27 | |
28 // Server cannot service the request now. | |
29 TRANSIENT_ERROR, | |
30 | |
31 // Server does not wish the client to retry any more until the action has | |
32 // been taken. | |
33 NON_RETRIABLE_ERROR, | |
34 | |
35 // Indicates the datatypes have been migrated and the client should resync | |
36 // them to get the latest progress markers. | |
37 MIGRATION_DONE, | |
38 | |
39 // Invalid Credential. | |
40 INVALID_CREDENTIAL, | |
41 | |
42 // The default value. | |
43 UNKNOWN_ERROR | |
44 }; | |
45 | |
46 enum ClientAction { | |
47 // Upgrade the client to latest version. | |
48 UPGRADE_CLIENT, | |
49 | |
50 // Clear user data and setup sync again. | |
51 CLEAR_USER_DATA_AND_RESYNC, | |
52 | |
53 // Set the bit on the account to enable sync. | |
54 ENABLE_SYNC_ON_ACCOUNT, | |
55 | |
56 // Stop sync and restart sync. | |
57 STOP_AND_RESTART_SYNC, | |
58 | |
59 // Wipe this client of any sync data. | |
60 DISABLE_SYNC_ON_CLIENT, | |
61 | |
62 // The default. No action. | |
63 UNKNOWN_ACTION | |
64 }; | |
65 | |
66 struct SyncProtocolError { | |
67 SyncProtocolErrorType error_type; | |
68 std::string error_description; | |
69 std::string url; | |
70 ClientAction action; | |
71 syncable::ModelTypeSet error_data_types; | |
72 SyncProtocolError(); | |
73 ~SyncProtocolError(); | |
74 DictionaryValue* ToValue() const; | |
75 }; | |
76 | |
77 const char* GetSyncErrorTypeString(SyncProtocolErrorType type); | |
78 const char* GetClientActionString(ClientAction action); | |
79 } // namespace browser_sync | |
80 #endif // CHROME_BROWSER_SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | |
81 | |
OLD | NEW |