Skip to content
Snippets Groups Projects
Commit d5d6cfad authored by Alex Vakulenko's avatar Alex Vakulenko
Browse files

ledflasher: Use helper Command::AbortWithCustomError() method

weaved now provides new variants of Command::Abort() that allow
to specify the error information as brillo::Error or binder::Status.

BUG: 25875613
Change-Id: Icf82c1c6c752eae7e651213d46e42baa103bef38
parent cb7cf4ae
No related branches found
No related tags found
No related merge requests found
......@@ -156,8 +156,7 @@ void Daemon::OnSet(std::unique_ptr<weaved::Command> command) {
bool on = command->GetParameter<bool>("on");
android::binder::Status status = led_service_->setLED(index - 1, on);
if (!status.isOk()) {
command->Abort("_system_error", status.exceptionMessage().string(),
nullptr);
command->AbortWithCustomError(status, nullptr);
return;
}
animation_.reset();
......@@ -183,8 +182,7 @@ void Daemon::OnToggle(std::unique_ptr<weaved::Command> command) {
if (status.isOk())
status = led_service_->setLED(index, !on);
if(!status.isOk()) {
command->Abort("_system_error", status.exceptionMessage().string(),
nullptr);
command->AbortWithCustomError(status, nullptr);
return;
}
animation_.reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment