Remove using assert() in ExternalStorage 31/200231/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 20 Feb 2019 10:10:06 +0000 (19:10 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 20 Feb 2019 10:11:13 +0000 (19:11 +0900)
Just return error instead of assert.

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

index 5d0cb8d..8604c23 100644 (file)
@@ -115,7 +115,7 @@ bool ExternalStorage::Finalize(bool success) {
                                                             uid_);
     break;
   default:
-    assert(false && "Not supported installation mode");
+    LOG(ERROR) << "Not supported installation mode";
   }
   return ret == APP2EXT_STATUS_SUCCESS;
 }
@@ -219,18 +219,10 @@ bool ExternalStorage::Initialize(
     ret = handle_->interface.client_usr_pre_migrate_legacy(pkgid_.c_str(),
                                                            uid_);
     break;
-  case RequestType::Reinstall:
-  case RequestType::Recovery:
-  case RequestType::RecoveryUpdate:
-  case RequestType::ManifestDirectInstall:
-  case RequestType::ManifestDirectUpdate:
-  case RequestType::MountInstall:
-  case RequestType::MountUpdate:
+  default:
     LOG(ERROR) << "Installation type is not supported by external installation";
     ret = -1;
     break;
-  default:
-    assert(false && "Invalid installation mode");
   }
 
   g_list_free_full(glist, &ClearApp2ExtDirDetail);