Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / sync / internal_api / public / util / syncer_error.cc
blob5c59e92287748066bfe2b378dd05b72dcd12ad77
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.
5 #include "sync/internal_api/public/util/syncer_error.h"
7 #include "base/logging.h"
9 namespace syncer {
11 #define ENUM_CASE(x) case x: return #x; break;
12 const char* GetSyncerErrorString(SyncerError value) {
13 switch (value) {
14 ENUM_CASE(UNSET);
15 ENUM_CASE(CANNOT_DO_WORK);
16 ENUM_CASE(NETWORK_CONNECTION_UNAVAILABLE);
17 ENUM_CASE(NETWORK_IO_ERROR);
18 ENUM_CASE(SYNC_SERVER_ERROR);
19 ENUM_CASE(SYNC_AUTH_ERROR);
20 ENUM_CASE(SERVER_RETURN_INVALID_CREDENTIAL);
21 ENUM_CASE(SERVER_RETURN_UNKNOWN_ERROR);
22 ENUM_CASE(SERVER_RETURN_THROTTLED);
23 ENUM_CASE(SERVER_RETURN_TRANSIENT_ERROR);
24 ENUM_CASE(SERVER_RETURN_MIGRATION_DONE);
25 ENUM_CASE(SERVER_RETURN_CLEAR_PENDING);
26 ENUM_CASE(SERVER_RETURN_NOT_MY_BIRTHDAY);
27 ENUM_CASE(SERVER_RETURN_CONFLICT);
28 ENUM_CASE(SERVER_RESPONSE_VALIDATION_FAILED);
29 ENUM_CASE(SERVER_RETURN_DISABLED_BY_ADMIN);
30 ENUM_CASE(SERVER_RETURN_USER_ROLLBACK);
31 ENUM_CASE(SERVER_RETURN_PARTIAL_FAILURE);
32 ENUM_CASE(SERVER_MORE_TO_DOWNLOAD);
33 ENUM_CASE(DATATYPE_TRIGGERED_RETRY);
34 ENUM_CASE(SYNCER_OK);
36 NOTREACHED();
37 return "INVALID";
39 #undef ENUM_CASE
41 bool SyncerErrorIsError(SyncerError error) {
42 return error != UNSET
43 && error != SYNCER_OK
44 && error != SERVER_MORE_TO_DOWNLOAD;
47 } // namespace syncer