Prevent fix in notification manager 70/1070/2
authorHarish Kumara Marappa <h.marappa@samsung.com>
Thu, 21 May 2015 13:27:26 +0000 (18:57 +0530)
committerUze Choi <uzchoi@samsung.com>
Thu, 21 May 2015 14:13:20 +0000 (14:13 +0000)
Change-Id: I3bed42533b88f2c9f266e77e3a9fb5f3ed84fbca
Signed-off-by: Harish Kumara Marappa <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1070
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification-manager/SampleApp/linux/sampleConsumer/SampleConsumer.cpp

index bacaa67..afb6de4 100644 (file)
@@ -369,27 +369,27 @@ int main(int argc , char *argv[])
             continue;
         }
 
-        switch ((int)in)
-        {
-            case OBSERVE:
-                startObserve(g_curResource);
-                break;
-            case GET:
-                startGet(g_curResource);
-                break;
-            case PUT:
-                startPut(g_curResource);
-                break;
-            case DELETE:
-                try {
+        try {
+            switch ((int)in)
+            {
+                case OBSERVE:
+                    startObserve(g_curResource);
+                    break;
+                case GET:
+                    startGet(g_curResource);
+                    break;
+                case PUT:
+                    startPut(g_curResource);
+                    break;
+                case DELETE:
                     startDelete(g_curResource);
-                }catch(OCException e) {
-                    std::cout<< "Caught OCException [Code: "<<e.code()<<" Reason: "<<e.reason()<<std::endl;
-                }
-                break;
-            default:
-                std::cout << "Invalid input, please try again" << std::endl;
-                break;
+                    break;
+                default:
+                    std::cout << "Invalid input, please try again" << std::endl;
+                    break;
+            }
+        }catch(OCException e) {
+            std::cout<< "Caught OCException [Code: "<<e.code()<<" Reason: "<<e.reason()<<std::endl;
         }
     }