OLD | NEW |
1 // Copyright (c) 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 SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ |
7 | 7 |
| 8 #include "sync/base/sync_export.h" |
| 9 |
8 namespace syncer { | 10 namespace syncer { |
9 | 11 |
10 // This enum describes all the ways a SyncerCommand can fail. | 12 // This enum describes all the ways a SyncerCommand can fail. |
11 // | 13 // |
12 // SyncerCommands do many different things, but they share a common function | 14 // SyncerCommands do many different things, but they share a common function |
13 // signature. This enum, the return value for all SyncerCommands, must be able | 15 // signature. This enum, the return value for all SyncerCommands, must be able |
14 // to describe any possible failure for all SyncerComand. | 16 // to describe any possible failure for all SyncerComand. |
15 // | 17 // |
16 // For convenience, functions which are invoked only by SyncerCommands may also | 18 // For convenience, functions which are invoked only by SyncerCommands may also |
17 // return a SyncerError. It saves us having to write a conversion function, and | 19 // return a SyncerError. It saves us having to write a conversion function, and |
(...skipping 16 matching lines...) Expand all Loading... |
34 SERVER_RETURN_TRANSIENT_ERROR, | 36 SERVER_RETURN_TRANSIENT_ERROR, |
35 SERVER_RETURN_MIGRATION_DONE, | 37 SERVER_RETURN_MIGRATION_DONE, |
36 SERVER_RETURN_CLEAR_PENDING, | 38 SERVER_RETURN_CLEAR_PENDING, |
37 SERVER_RETURN_NOT_MY_BIRTHDAY, | 39 SERVER_RETURN_NOT_MY_BIRTHDAY, |
38 SERVER_RETURN_CONFLICT, | 40 SERVER_RETURN_CONFLICT, |
39 SERVER_RESPONSE_VALIDATION_FAILED, | 41 SERVER_RESPONSE_VALIDATION_FAILED, |
40 | 42 |
41 SYNCER_OK | 43 SYNCER_OK |
42 }; | 44 }; |
43 | 45 |
44 const char * GetSyncerErrorString(SyncerError); | 46 SYNC_EXPORT const char* GetSyncerErrorString(SyncerError); |
45 | 47 |
46 // Helper to check that |error| is set to something (not UNSET) and is not | 48 // Helper to check that |error| is set to something (not UNSET) and is not |
47 // SYNCER_OK. | 49 // SYNCER_OK. |
48 bool SyncerErrorIsError(SyncerError error); | 50 bool SyncerErrorIsError(SyncerError error); |
49 | 51 |
50 } // namespace syncer | 52 } // namespace syncer |
51 | 53 |
52 #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ | 54 #endif // SYNC_INTERNAL_API_PUBLIC_UTIL_SYNCER_ERROR_H_ |
OLD | NEW |