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

Unified Diff: chrome/browser/sync/glue/autofill_change_processor.cc

Issue 2002012: sync: Add location info to unrecoverable error. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add error handler back to bookmark model associator Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/glue/autofill_data_type_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/autofill_change_processor.cc
===================================================================
--- chrome/browser/sync/glue/autofill_change_processor.cc (revision 48898)
+++ chrome/browser/sync/glue/autofill_change_processor.cc (working copy)
@@ -58,9 +58,9 @@
sync_api::WriteTransaction trans(share_handle());
sync_api::ReadNode autofill_root(&trans);
if (!autofill_root.InitByTagLookup(kAutofillTag)) {
- error_handler()->OnUnrecoverableError();
- LOG(ERROR) << "Server did not create the top-level autofill node. "
- << "We might be running against an out-of-date server.";
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Server did not create the top-level autofill node. "
+ "We might be running against an out-of-date server.");
return;
}
@@ -92,15 +92,17 @@
string16 label(AutofillModelAssociator::MakeUniqueLabel(profile->Label(),
trans));
if (label.empty()) {
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "No unique label; can't move aside");
return;
}
tag->assign(AutofillModelAssociator::ProfileLabelToTag(label));
profile->set_label(label);
if (!web_database_->UpdateAutoFillProfile(*profile)) {
- LOG(ERROR) << "Failed to overwrite label for node" << label;
- error_handler()->OnUnrecoverableError();
+ std::string err = "Failed to overwrite label for node ";
+ err += UTF16ToUTF8(label);
+ error_handler()->OnUnrecoverableError(FROM_HERE, err);
return;
}
@@ -120,8 +122,8 @@
const std::string& tag, const AutoFillProfile* profile) {
sync_api::WriteNode sync_node(trans);
if (!sync_node.InitUniqueByCreation(syncable::AUTOFILL, autofill, tag)) {
- LOG(ERROR) << "Failed to create autofill sync node.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Failed to create autofill sync node.");
return;
}
sync_node.SetTitle(UTF8ToWide(tag));
@@ -160,13 +162,13 @@
}
int64 sync_id = model_associator_->GetSyncIdFromChromeId(tag);
if (sync_api::kInvalidId == sync_id) {
- LOG(ERROR) << "Unexpected notification for: " << tag;
- error_handler()->OnUnrecoverableError();
+ std::string err = "Unexpected notification for: " + tag;
+ error_handler()->OnUnrecoverableError(FROM_HERE, err);
return;
} else {
if (!sync_node.InitByIdLookup(sync_id)) {
- LOG(ERROR) << "Autofill node lookup failed.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Autofill node lookup failed.");
return;
}
WriteAutofillProfile(*change->profile(), &sync_node);
@@ -194,8 +196,8 @@
change->key().value());
if (!sync_node.InitUniqueByCreation(syncable::AUTOFILL,
autofill_root, tag)) {
- LOG(ERROR) << "Failed to create autofill sync node.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Failed to create autofill sync node.");
return;
}
@@ -204,8 +206,8 @@
change->key().name(),
change->key().value(),
&timestamps)) {
- LOG(ERROR) << "Failed to get timestamps.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Failed to get timestamps.");
return;
}
@@ -225,14 +227,14 @@
change->key().name(), change->key().value());
int64 sync_id = model_associator_->GetSyncIdFromChromeId(tag);
if (sync_api::kInvalidId == sync_id) {
- LOG(ERROR) << "Unexpected notification for: " <<
- change->key().name();
- error_handler()->OnUnrecoverableError();
+ std::string err = "Unexpected notification for: " +
+ UTF16ToUTF8(change->key().name());
+ error_handler()->OnUnrecoverableError(FROM_HERE, err);
return;
} else {
if (!sync_node.InitByIdLookup(sync_id)) {
- LOG(ERROR) << "Autofill node lookup failed.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Autofill node lookup failed.");
return;
}
}
@@ -242,8 +244,8 @@
change->key().name(),
change->key().value(),
&timestamps)) {
- LOG(ERROR) << "Failed to get timestamps.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Failed to get timestamps.");
return;
}
@@ -266,13 +268,13 @@
sync_api::WriteNode sync_node(trans);
int64 sync_id = model_associator_->GetSyncIdFromChromeId(tag);
if (sync_api::kInvalidId == sync_id) {
- LOG(ERROR) << "Unexpected notification";
- error_handler()->OnUnrecoverableError();
+ std::string err = "Unexpected notification for: " + tag;
+ error_handler()->OnUnrecoverableError(FROM_HERE, err);
return;
} else {
if (!sync_node.InitByIdLookup(sync_id)) {
- LOG(ERROR) << "Autofill node lookup failed.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Autofill node lookup failed.");
return;
}
model_associator_->Disassociate(sync_node.GetId());
@@ -291,8 +293,8 @@
sync_api::ReadNode autofill_root(trans);
if (!autofill_root.InitByTagLookup(kAutofillTag)) {
- LOG(ERROR) << "Autofill root node lookup failed.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Autofill root node lookup failed.");
return;
}
@@ -316,8 +318,8 @@
// Handle an update or add.
sync_api::ReadNode sync_node(trans);
if (!sync_node.InitByIdLookup(changes[i].id)) {
- LOG(ERROR) << "Autofill node lookup failed.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Autofill node lookup failed.");
return;
}
@@ -337,8 +339,8 @@
}
if (!web_database_->UpdateAutofillEntries(new_entries)) {
- LOG(ERROR) << "Could not update autofill entries.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Could not update autofill entries.");
return;
}
@@ -351,8 +353,8 @@
const sync_pb::AutofillSpecifics& autofill) {
if (!web_database_->RemoveFormElement(
UTF8ToUTF16(autofill.name()), UTF8ToUTF16(autofill.value()))) {
- LOG(ERROR) << "Could not remove autofill node.";
- error_handler()->OnUnrecoverableError();
+ error_handler()->OnUnrecoverableError(FROM_HERE,
+ "Could not remove autofill node.");
return;
}
}
« no previous file with comments | « no previous file | chrome/browser/sync/glue/autofill_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698