Add exception handler 54/143554/2
authorSeungha Son <seungha.son@samsung.com>
Thu, 10 Aug 2017 09:53:36 +0000 (18:53 +0900)
committerSon seungha <seungha.son@samsung.com>
Thu, 10 Aug 2017 09:55:17 +0000 (09:55 +0000)
Signed-off-by: Seungha Son <seungha.son@samsung.com>
Change-Id: I4efd0db6fe47e21da0cd84380a974bb247f5a3be

src/pkg_recovery/pkg_recovery_helper.cc

index ea333a8..3d4edf3 100644 (file)
@@ -115,7 +115,13 @@ std::vector<RecoverEntry> SearchRecoveryFiles(uid_t uid) {
 int main() {
   uid_t uid = getuid();
   std::vector<std::pair<std::string, std::string>> list;
-  list = SearchRecoveryFiles(uid);
+  try {
+    list = SearchRecoveryFiles(uid);
+  } catch (...) {
+    LOG(WARNING) << "Exception occurred: "
+                 << boost::current_exception_diagnostic_information();
+    return 0;
+  }
   for (auto entry : list) {
     if (!RequestRecoveryService(uid, entry.first.c_str(),
         entry.second.c_str()))