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