From a21d8f7e28687006f4be2385479cd63aede5a224 Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Fri, 5 Jan 2018 16:51:10 +0900 Subject: [PATCH] Send error signal properly when installation failed 'status' which is result of each step should not be overwritten by undo and clean operation. Change-Id: Ia39713c5f480645536f4e6dfd187bbf05b0905e7 Signed-off-by: Sangyoon Jang --- src/common/app_installer.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/app_installer.cc b/src/common/app_installer.cc index 9a3f98f..c670a3a 100644 --- a/src/common/app_installer.cc +++ b/src/common/app_installer.cc @@ -132,8 +132,9 @@ AppInstaller::Result AppInstaller::Run() { if (it != itEnd && ret == Result::ERROR) { LOG(ERROR) << "Failure occurs in step: " << (*it)->name(); do { - status = SafeExecute(*it, &Step::undo, "undo"); - if (Step::Status::OK != status) { + if (SafeExecute(*it, &Step::undo, "undo") != Step::Status::OK) { + LOG(ERROR) << "Error during undo operation(" << (*it)->name() + << "), but continuing..."; ret = Result::UNDO_ERROR; } } while (it-- != itStart); @@ -141,8 +142,8 @@ AppInstaller::Result AppInstaller::Run() { do { if (it == itEnd) --it; - status = SafeExecute(*it, &Step::clean, "clean"); - if (Step::Status::OK != status) { + if (SafeExecute(*it, &Step::clean, "clean") != Step::Status::OK) { + LOG(ERROR) << "Error during clean operation(" << (*it)->name() << ")"; ret = Result::CLEANUP_ERROR; break; } -- 2.7.4