Fix static analysis issue 89/240189/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Mon, 3 Aug 2020 07:32:26 +0000 (16:32 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 4 Aug 2020 08:17:08 +0000 (08:17 +0000)
Fix uncaught exepction.

Change-Id: Iaecd4303cbdc18e848b614e3df8520ee05a85b9b
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
(cherry picked from commit 7335f169e18a7b152b4390a4da19400a726c897e)

src/unit_tests/recovery_test.cc

index 2cbcefcef4dcd2551352db2c0689cd5434232314..183f126a50d72bbeee901a43ee52dd135ea06226 100644 (file)
@@ -397,6 +397,11 @@ int main(int argc,  char** argv) {
       }
     }
     bpo::notify(opt_map);
+
+    if (req_type == ReqType::UNKNOWN_REQ) {
+      std::cerr << options << std::endl;
+      return 0;
+    }
   } catch (...) {
     std::cerr << "Exception occurred: "
               << boost::current_exception_diagnostic_information()
@@ -404,11 +409,6 @@ int main(int argc,  char** argv) {
     return -1;
   }
 
-  if (req_type == ReqType::UNKNOWN_REQ) {
-    std::cerr << options << std::endl;
-    return 0;
-  }
-
   try {
     char buf[10][kBufSize] = { 0, };
     std::vector<char *> gtest_argv;