| OLD | NEW |
| 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/protocol/sync_protocol_error.h" | 5 #include "sync/protocol/sync_protocol_error.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 | 11 |
| 12 namespace syncer { | 12 namespace syncer { |
| 13 #define ENUM_CASE(x) case x: return #x; break; | 13 #define ENUM_CASE(x) case x: return #x; break; |
| 14 | 14 |
| 15 const char* GetSyncErrorTypeString(SyncProtocolErrorType type) { | 15 const char* GetSyncErrorTypeString(SyncProtocolErrorType type) { |
| 16 switch (type) { | 16 switch (type) { |
| 17 ENUM_CASE(SYNC_SUCCESS); | 17 ENUM_CASE(SYNC_SUCCESS); |
| 18 ENUM_CASE(NOT_MY_BIRTHDAY); | 18 ENUM_CASE(NOT_MY_BIRTHDAY); |
| 19 ENUM_CASE(THROTTLED); | 19 ENUM_CASE(THROTTLED); |
| 20 ENUM_CASE(CLEAR_PENDING); | 20 ENUM_CASE(CLEAR_PENDING); |
| 21 ENUM_CASE(TRANSIENT_ERROR); | 21 ENUM_CASE(TRANSIENT_ERROR); |
| 22 ENUM_CASE(NON_RETRIABLE_ERROR); | |
| 23 ENUM_CASE(MIGRATION_DONE); | 22 ENUM_CASE(MIGRATION_DONE); |
| 24 ENUM_CASE(INVALID_CREDENTIAL); | 23 ENUM_CASE(INVALID_CREDENTIAL); |
| 25 ENUM_CASE(DISABLED_BY_ADMIN); | 24 ENUM_CASE(DISABLED_BY_ADMIN); |
| 26 ENUM_CASE(USER_ROLLBACK); | 25 ENUM_CASE(USER_ROLLBACK); |
| 27 ENUM_CASE(PARTIAL_FAILURE); | 26 ENUM_CASE(PARTIAL_FAILURE); |
| 28 ENUM_CASE(CLIENT_DATA_OBSOLETE); | 27 ENUM_CASE(CLIENT_DATA_OBSOLETE); |
| 29 ENUM_CASE(UNKNOWN_ERROR); | 28 ENUM_CASE(UNKNOWN_ERROR); |
| 30 } | 29 } |
| 31 NOTREACHED(); | 30 NOTREACHED(); |
| 32 return ""; | 31 return ""; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 value->SetString("ErrorType", | 61 value->SetString("ErrorType", |
| 63 GetSyncErrorTypeString(error_type)); | 62 GetSyncErrorTypeString(error_type)); |
| 64 value->SetString("ErrorDescription", error_description); | 63 value->SetString("ErrorDescription", error_description); |
| 65 value->SetString("url", url); | 64 value->SetString("url", url); |
| 66 value->SetString("action", GetClientActionString(action)); | 65 value->SetString("action", GetClientActionString(action)); |
| 67 return value; | 66 return value; |
| 68 } | 67 } |
| 69 | 68 |
| 70 } // namespace syncer | 69 } // namespace syncer |
| 71 | 70 |
| OLD | NEW |