Catch DatabaseError while getting widget list in wrt-launcher
authorKarol Pawlowski <k.pawlowski@samsung.com>
Fri, 13 Sep 2013 12:13:21 +0000 (14:13 +0200)
committerHoseon LEE <hoseon46.lee@samsung.com>
Sun, 29 Sep 2013 08:07:25 +0000 (17:07 +0900)
[Issue#]   N_SE-51978
[Problem]  wrt-launcher has closed unexpectedly
[Cause]    The reason may be some uncaught exception
[Solution] Try Catch block added

Change-Id: Id8855b4637c2c5f507b3928ccab4686d7c955504

src/wrt-launcher/wrt-launcher.cpp

index f48d491..5c9fc0d 100644 (file)
@@ -115,8 +115,14 @@ static bool display_widget_info()
         return FALSE;
     }
 
-    WidgetDAOReadOnlyList widgetList =
-        WrtDB::WidgetDAOReadOnly::getWidgetList();
+    WidgetDAOReadOnlyList widgetList;
+
+    Try {
+        widgetList = WrtDB::WidgetDAOReadOnly::getWidgetList();
+    } Catch (WrtDB::WidgetDAOReadOnly::Exception::DatabaseError) {
+        LogError("Fail to get WidgetList");
+        return FALSE;
+    }
 
     printf("%3s %32s %16s %64s %16s %24s\n",
            "No", "Name", "Version", "GUID", "Package ID", "App ID");