diff --git a/src/ledflasher/ledflasher.cpp b/src/ledflasher/ledflasher.cpp index 7a991b15c95471274ce6425b533912c6399cc3c5..f39dbf27e027a25c80e2998505bf34abfab7380c 100644 --- a/src/ledflasher/ledflasher.cpp +++ b/src/ledflasher/ledflasher.cpp @@ -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();