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

Side by Side Diff: chrome/browser/sync_file_system/drive_file_sync_util.cc

Issue 12916010: SyncFS: -1 GDataErrorCode should be handled gracefully (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « no previous file | 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 "chrome/browser/sync_file_system/drive_file_sync_util.h" 5 #include "chrome/browser/sync_file_system/drive_file_sync_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace sync_file_system { 9 namespace sync_file_system {
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 case google_apis::HTTP_FORBIDDEN: 49 case google_apis::HTTP_FORBIDDEN:
50 case google_apis::HTTP_LENGTH_REQUIRED: 50 case google_apis::HTTP_LENGTH_REQUIRED:
51 case google_apis::HTTP_PRECONDITION: 51 case google_apis::HTTP_PRECONDITION:
52 case google_apis::GDATA_PARSE_ERROR: 52 case google_apis::GDATA_PARSE_ERROR:
53 case google_apis::GDATA_OTHER_ERROR: 53 case google_apis::GDATA_OTHER_ERROR:
54 return SYNC_STATUS_FAILED; 54 return SYNC_STATUS_FAILED;
55 55
56 case google_apis::GDATA_NO_SPACE: 56 case google_apis::GDATA_NO_SPACE:
57 return SYNC_FILE_ERROR_NO_SPACE; 57 return SYNC_FILE_ERROR_NO_SPACE;
58 } 58 }
59 NOTREACHED(); 59
60 // There's a case where DriveService layer returns GDataErrorCode==-1
61 // when network is unavailable. (http://crbug.com/223042)
62 // TODO(kinuko,nhiroki): We should identify from where this undefined error
63 // code is coming.
64 if (error == -1)
65 return SYNC_STATUS_NETWORK_ERROR;
66
67 LOG(WARNING) << "Got unexpected error: " << error;
60 return SYNC_STATUS_FAILED; 68 return SYNC_STATUS_FAILED;
61 } 69 }
62 70
63 google_apis::GDataErrorCode DriveUploadErrorToGDataErrorCode( 71 google_apis::GDataErrorCode DriveUploadErrorToGDataErrorCode(
64 google_apis::DriveUploadError error) { 72 google_apis::DriveUploadError error) {
65 switch (error) { 73 switch (error) {
66 case google_apis::DRIVE_UPLOAD_OK: 74 case google_apis::DRIVE_UPLOAD_OK:
67 return google_apis::HTTP_SUCCESS; 75 return google_apis::HTTP_SUCCESS;
68 case google_apis::DRIVE_UPLOAD_ERROR_NOT_FOUND: 76 case google_apis::DRIVE_UPLOAD_ERROR_NOT_FOUND:
69 return google_apis::HTTP_NOT_FOUND; 77 return google_apis::HTTP_NOT_FOUND;
70 case google_apis::DRIVE_UPLOAD_ERROR_NO_SPACE: 78 case google_apis::DRIVE_UPLOAD_ERROR_NO_SPACE:
71 return google_apis::GDATA_NO_SPACE; 79 return google_apis::GDATA_NO_SPACE;
72 case google_apis::DRIVE_UPLOAD_ERROR_CONFLICT: 80 case google_apis::DRIVE_UPLOAD_ERROR_CONFLICT:
73 return google_apis::HTTP_CONFLICT; 81 return google_apis::HTTP_CONFLICT;
74 case google_apis::DRIVE_UPLOAD_ERROR_ABORT: 82 case google_apis::DRIVE_UPLOAD_ERROR_ABORT:
75 return google_apis::GDATA_OTHER_ERROR; 83 return google_apis::GDATA_OTHER_ERROR;
76 } 84 }
77 NOTREACHED(); 85 NOTREACHED();
78 return google_apis::GDATA_OTHER_ERROR; 86 return google_apis::GDATA_OTHER_ERROR;
79 } 87 }
80 88
81 } // namespace sync_file_system 89 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698