Index: chrome/browser/chromeos/drive/change_list_processor.cc |
diff --git a/chrome/browser/chromeos/drive/change_list_processor.cc b/chrome/browser/chromeos/drive/change_list_processor.cc |
index ac01e49b0771c5cbe346731da7c9a11363a4efaa..c5e620582a058cdaf9484dc8a5cd22548ea5024b 100644 |
--- a/chrome/browser/chromeos/drive/change_list_processor.cc |
+++ b/chrome/browser/chromeos/drive/change_list_processor.cc |
@@ -286,9 +286,11 @@ FileError ChangeListProcessor::ApplyEntryMap( |
if (it->first != root.resource_id()) { |
// TODO(hashimoto): Handle ApplyEntry errors correctly. |
kinaba
2014/04/28 08:28:52
nit: Do you still need this TODO comment?
hashimoto
2014/04/28 09:30:54
Done.
|
FileError error = ApplyEntry(it->second); |
- DLOG_IF(WARNING, error != FILE_ERROR_OK) |
- << "ApplyEntry failed: " << FileErrorToString(error) |
- << ", title = " << it->second.title(); |
+ if (error != FILE_ERROR_OK) { |
+ LOG(ERROR) << "ApplyEntry failed: " << FileErrorToString(error) |
+ << ", title = " << it->second.title(); |
+ return error; |
+ } |
} |
entry_map_.erase(it); |
} |
@@ -299,12 +301,21 @@ FileError ChangeListProcessor::ApplyEntryMap( |
std::string local_id; |
FileError error = resource_metadata_->GetIdByResourceId( |
deleted_resource_ids[i], &local_id); |
- if (error == FILE_ERROR_OK) |
- error = resource_metadata_->RemoveEntry(local_id); |
- |
- DLOG_IF(WARNING, error != FILE_ERROR_OK && error != FILE_ERROR_NOT_FOUND) |
- << "Failed to delete: " << FileErrorToString(error) |
- << ", resource_id = " << deleted_resource_ids[i]; |
+ switch (error) { |
+ case FILE_ERROR_OK: |
+ error = resource_metadata_->RemoveEntry(local_id); |
+ break; |
+ case FILE_ERROR_NOT_FOUND: |
+ error = FILE_ERROR_OK; |
+ break; |
+ default: |
+ break; |
+ } |
+ if (error != FILE_ERROR_OK) { |
+ LOG(ERROR) << "Failed to delete: " << FileErrorToString(error) |
+ << ", resource_id = " << deleted_resource_ids[i]; |
+ return error; |
+ } |
} |
return FILE_ERROR_OK; |