OLD | NEW |
| (Empty) |
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 | |
5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_ | |
6 #define CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_ | |
7 #pragma once | |
8 | |
9 namespace browser_sync { | |
10 | |
11 // This enum describes all the ways a SyncerCommand can fail. | |
12 // | |
13 // SyncerCommands do many different things, but they share a common function | |
14 // signature. This enum, the return value for all SyncerCommands, must be able | |
15 // to describe any possible failure for all SyncerComand. | |
16 // | |
17 // For convenience, functions which are invoked only by SyncerCommands may also | |
18 // return a SyncerError. It saves us having to write a conversion function, and | |
19 // it makes refactoring easier. | |
20 enum SyncerError { | |
21 UNSET = 0, // Default value. | |
22 DIRECTORY_LOOKUP_FAILED, // Local directory lookup failure. | |
23 | |
24 NETWORK_CONNECTION_UNAVAILABLE, // Connectivity failure. | |
25 NETWORK_IO_ERROR, // Response buffer read error. | |
26 SYNC_SERVER_ERROR, // Non auth HTTP error. | |
27 SYNC_AUTH_ERROR, // HTTP auth error. | |
28 | |
29 // Based on values returned by server. Most are defined in sync.proto. | |
30 SERVER_RETURN_INVALID_CREDENTIAL, | |
31 SERVER_RETURN_UNKNOWN_ERROR, | |
32 SERVER_RETURN_THROTTLED, | |
33 SERVER_RETURN_TRANSIENT_ERROR, | |
34 SERVER_RETURN_MIGRATION_DONE, | |
35 SERVER_RETURN_CLEAR_PENDING, | |
36 SERVER_RETURN_NOT_MY_BIRTHDAY, | |
37 SERVER_RESPONSE_VALIDATION_FAILED, | |
38 | |
39 SYNCER_OK | |
40 }; | |
41 | |
42 const char * GetSyncerErrorString(SyncerError); | |
43 | |
44 } // namespace browser_sync | |
45 | |
46 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_INCLUDES_SYNCER_ERROR_H_ | |
OLD | NEW |