update_engine: Use helper Command::AbortWithCustomError() method
am: c7cc45e4ac
* commit 'c7cc45e4ac9ca1f4693dfc93e4ff203992d446a1':
update_engine: Use helper Command::AbortWithCustomError() method
diff --git a/update_attempter.cc b/update_attempter.cc
index bc06502..dd7c1be 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -1098,7 +1098,7 @@
brillo::Error::AddTo(error,
FROM_HERE,
brillo::errors::dbus::kDomain,
- "_set_target_error",
+ "set_target_error",
error_message);
return false;
}
diff --git a/weave_service.cc b/weave_service.cc
index 414234c..c6a67f2 100644
--- a/weave_service.cc
+++ b/weave_service.cc
@@ -101,7 +101,7 @@
void WeaveService::OnCheckForUpdates(std::unique_ptr<weaved::Command> command) {
brillo::ErrorPtr error;
if (!delegate_->OnCheckForUpdates(&error)) {
- command->Abort(error->GetCode(), error->GetMessage(), nullptr);
+ command->AbortWithCustomError(error.get(), nullptr);
return;
}
command->Complete({}, nullptr);
@@ -111,7 +111,7 @@
string channel = command->GetParameter<string>("channel");
brillo::ErrorPtr error;
if (!delegate_->OnTrackChannel(channel, &error)) {
- command->Abort(error->GetCode(), error->GetMessage(), nullptr);
+ command->AbortWithCustomError(error.get(), nullptr);
return;
}
command->Complete({}, nullptr);