Add exception handler in volume manager 92/197892/3 accepted/tizen_5.0_unified accepted/tizen_unified tizen_5.0 accepted/tizen/5.0/unified/20190304.054838 accepted/tizen/unified/20190307.230806 submit/tizen/20190222.075321 submit/tizen/20190225.022013 submit/tizen_5.0/20190222.075859
authorSungbae Yoo <sungbae.yoo@samsung.com>
Thu, 17 Jan 2019 03:57:07 +0000 (12:57 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Tue, 29 Jan 2019 02:51:25 +0000 (11:51 +0900)
It is to solve a SVACE issue.

Change-Id: Ia396f11c51d37e11ba731eab808f6fc6792fd6ec
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
volume/main.cpp

index a2fa0db..6c3024f 100755 (executable)
@@ -163,22 +163,26 @@ int main(int argc, char* argv[])
                {0, 0, 0, 0}
        };
 
-       while ((opt = getopt_long(argc, argv, "ag:m:", options, &index)) != -1) {
-               switch (opt) {
-               case 'a':
-                       ret = mountEcryptfsToAll();
-                       break;
-               case 'g':
-                       ret = generateKey(optarg);
-                       break;
-               case 'm':
-                       ret = mountEcryptfs("/home/" + std::string(optarg), optarg);
-                       break;
-               default:
-                       std::cerr << "unknown" << std::endl;
-                       usage(argv[0]);
-                       break;
+       try {
+               while ((opt = getopt_long(argc, argv, "ag:m:", options, &index)) != -1) {
+                       switch (opt) {
+                       case 'a':
+                               ret = mountEcryptfsToAll();
+                               break;
+                       case 'g':
+                               ret = generateKey(optarg);
+                               break;
+                       case 'm':
+                               ret = mountEcryptfs("/home/" + std::string(optarg), optarg);
+                               break;
+                       default:
+                               std::cerr << "unknown" << std::endl;
+                               usage(argv[0]);
+                               break;
+                       }
                }
+       } catch (klay::Exception &e) {
+               ret = -1;
        }
 
        if (ret != 0) {