Send error signal properly when installation failed 19/166019/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Fri, 5 Jan 2018 07:51:10 +0000 (16:51 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Fri, 5 Jan 2018 09:20:59 +0000 (09:20 +0000)
'status' which is result of each step should not be overwritten by undo
and clean operation.

Change-Id: Ia39713c5f480645536f4e6dfd187bbf05b0905e7
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/app_installer.cc

index 9a3f98f..c670a3a 100644 (file)
@@ -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;
       }