| 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/api/sync_error.h" | 5 #include "sync/api/sync_error.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 break; | 27 break; |
| 28 case DATATYPE_ERROR: | 28 case DATATYPE_ERROR: |
| 29 type_message = "datatype error was encountered: "; | 29 type_message = "datatype error was encountered: "; |
| 30 break; | 30 break; |
| 31 case PERSISTENCE_ERROR: | 31 case PERSISTENCE_ERROR: |
| 32 type_message = "persistence error was encountered: "; | 32 type_message = "persistence error was encountered: "; |
| 33 break; | 33 break; |
| 34 case CRYPTO_ERROR: | 34 case CRYPTO_ERROR: |
| 35 type_message = "cryptographer error was encountered: "; | 35 type_message = "cryptographer error was encountered: "; |
| 36 break; | 36 break; |
| 37 default: | 37 case UNREADY_ERROR: |
| 38 NOTREACHED(); | 38 type_message = "unready error was encountered: "; |
| 39 type_message = "invalid error: "; | 39 break; |
| 40 case UNSET: |
| 41 NOTREACHED() << "Invalid error type"; |
| 42 return; |
| 40 } | 43 } |
| 41 Init(location, type_message + custom_message, model_type, error_type); | 44 Init(location, type_message + custom_message, model_type, error_type); |
| 42 PrintLogError(); | 45 PrintLogError(); |
| 43 } | 46 } |
| 44 | 47 |
| 45 SyncError::SyncError(const SyncError& other) { | 48 SyncError::SyncError(const SyncError& other) { |
| 46 Copy(other); | 49 Copy(other); |
| 47 } | 50 } |
| 48 | 51 |
| 49 SyncError::~SyncError() { | 52 SyncError::~SyncError() { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 logging::LOG_ERROR).stream(), | 134 logging::LOG_ERROR).stream(), |
| 132 LOG_IS_ON(ERROR)) | 135 LOG_IS_ON(ERROR)) |
| 133 << ModelTypeToString(model_type_) << " " << message_; | 136 << ModelTypeToString(model_type_) << " " << message_; |
| 134 } | 137 } |
| 135 | 138 |
| 136 void PrintTo(const SyncError& sync_error, std::ostream* os) { | 139 void PrintTo(const SyncError& sync_error, std::ostream* os) { |
| 137 *os << sync_error.ToString(); | 140 *os << sync_error.ToString(); |
| 138 } | 141 } |
| 139 | 142 |
| 140 } // namespace syncer | 143 } // namespace syncer |
| OLD | NEW |