OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ | 5 #ifndef COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ |
6 #define COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ | 6 #define COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ |
7 | 7 |
8 #include "components/sync/base/sync_export.h" | |
9 | |
10 namespace syncer { | 8 namespace syncer { |
11 | 9 |
12 // This enum describes all the possible results of a sync cycle. | 10 // This enum describes all the possible results of a sync cycle. |
13 enum SyncerError { | 11 enum SyncerError { |
14 UNSET = 0, // Default value. | 12 UNSET = 0, // Default value. |
15 CANNOT_DO_WORK, // A model worker could not process a work item. | 13 CANNOT_DO_WORK, // A model worker could not process a work item. |
16 | 14 |
17 NETWORK_CONNECTION_UNAVAILABLE, // Connectivity failure. | 15 NETWORK_CONNECTION_UNAVAILABLE, // Connectivity failure. |
18 NETWORK_IO_ERROR, // Response buffer read error. | 16 NETWORK_IO_ERROR, // Response buffer read error. |
19 SYNC_SERVER_ERROR, // Non auth HTTP error. | 17 SYNC_SERVER_ERROR, // Non auth HTTP error. |
(...skipping 15 matching lines...) Expand all Loading... |
35 SERVER_RETURN_CLIENT_DATA_OBSOLETE, | 33 SERVER_RETURN_CLIENT_DATA_OBSOLETE, |
36 | 34 |
37 // A datatype decided the sync cycle needed to be performed again. | 35 // A datatype decided the sync cycle needed to be performed again. |
38 DATATYPE_TRIGGERED_RETRY, | 36 DATATYPE_TRIGGERED_RETRY, |
39 | 37 |
40 SERVER_MORE_TO_DOWNLOAD, | 38 SERVER_MORE_TO_DOWNLOAD, |
41 | 39 |
42 SYNCER_OK | 40 SYNCER_OK |
43 }; | 41 }; |
44 | 42 |
45 SYNC_EXPORT const char* GetSyncerErrorString(SyncerError); | 43 const char* GetSyncerErrorString(SyncerError); |
46 | 44 |
47 // Helper to check that |error| is set to something (not UNSET) and is not | 45 // Helper to check that |error| is set to something (not UNSET) and is not |
48 // SYNCER_OK. | 46 // SYNCER_OK. |
49 bool SyncerErrorIsError(SyncerError error); | 47 bool SyncerErrorIsError(SyncerError error); |
50 | 48 |
51 } // namespace syncer | 49 } // namespace syncer |
52 | 50 |
53 #endif // COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ | 51 #endif // COMPONENTS_SYNC_BASE_SYNCER_ERROR_H_ |
OLD | NEW |