Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sync/internal_api/public/util/syncer_error.cc

Issue 11411041: sync: Retry soon when server returns conflict (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/public/util/syncer_error.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "sync/internal_api/public/util/syncer_error.h" 5 #include "sync/internal_api/public/util/syncer_error.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace syncer { 9 namespace syncer {
10 10
11 #define ENUM_CASE(x) case x: return #x; break; 11 #define ENUM_CASE(x) case x: return #x; break;
12 const char* GetSyncerErrorString(SyncerError value) { 12 const char* GetSyncerErrorString(SyncerError value) {
13 switch (value) { 13 switch (value) {
14 ENUM_CASE(UNSET); 14 ENUM_CASE(UNSET);
15 ENUM_CASE(DIRECTORY_LOOKUP_FAILED);
16 ENUM_CASE(CANNOT_DO_WORK); 15 ENUM_CASE(CANNOT_DO_WORK);
17 ENUM_CASE(NETWORK_CONNECTION_UNAVAILABLE); 16 ENUM_CASE(NETWORK_CONNECTION_UNAVAILABLE);
18 ENUM_CASE(NETWORK_IO_ERROR); 17 ENUM_CASE(NETWORK_IO_ERROR);
19 ENUM_CASE(SYNC_SERVER_ERROR); 18 ENUM_CASE(SYNC_SERVER_ERROR);
20 ENUM_CASE(SYNC_AUTH_ERROR); 19 ENUM_CASE(SYNC_AUTH_ERROR);
21 ENUM_CASE(SERVER_RETURN_INVALID_CREDENTIAL); 20 ENUM_CASE(SERVER_RETURN_INVALID_CREDENTIAL);
22 ENUM_CASE(SERVER_RETURN_UNKNOWN_ERROR); 21 ENUM_CASE(SERVER_RETURN_UNKNOWN_ERROR);
23 ENUM_CASE(SERVER_RETURN_THROTTLED); 22 ENUM_CASE(SERVER_RETURN_THROTTLED);
24 ENUM_CASE(SERVER_RETURN_TRANSIENT_ERROR); 23 ENUM_CASE(SERVER_RETURN_TRANSIENT_ERROR);
25 ENUM_CASE(SERVER_RETURN_MIGRATION_DONE); 24 ENUM_CASE(SERVER_RETURN_MIGRATION_DONE);
26 ENUM_CASE(SERVER_RETURN_CLEAR_PENDING); 25 ENUM_CASE(SERVER_RETURN_CLEAR_PENDING);
27 ENUM_CASE(SERVER_RETURN_NOT_MY_BIRTHDAY); 26 ENUM_CASE(SERVER_RETURN_NOT_MY_BIRTHDAY);
27 ENUM_CASE(SERVER_RETURN_CONFLICT);
28 ENUM_CASE(SERVER_RESPONSE_VALIDATION_FAILED); 28 ENUM_CASE(SERVER_RESPONSE_VALIDATION_FAILED);
29 ENUM_CASE(SYNCER_OK); 29 ENUM_CASE(SYNCER_OK);
30 } 30 }
31 NOTREACHED(); 31 NOTREACHED();
32 return "INVALID"; 32 return "INVALID";
33 } 33 }
34 #undef ENUM_CASE 34 #undef ENUM_CASE
35 35
36 bool SyncerErrorIsError(SyncerError error) { 36 bool SyncerErrorIsError(SyncerError error) {
37 return error != UNSET && error != SYNCER_OK; 37 return error != UNSET && error != SYNCER_OK;
38 } 38 }
39 39
40 } // namespace syncer 40 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/util/syncer_error.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698