Add log for add db execution failed
[platform/core/appfw/pkgmgr-info.git] / src / server / pkginfo_internal.cc
index 3b79f5c..40492ad 100644 (file)
@@ -911,7 +911,7 @@ int InsertSplashscreenInfo(const tizen_base::Database& db,
         .Bind(ss->operation)
         .Bind(ss->color_depth);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -968,7 +968,7 @@ int InsertPackageAppdefinedPrivilegeInfo(const tizen_base::Database& db,
         .Bind(priv->license)
         .Bind(priv->type);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1000,7 +1000,7 @@ int InsertPackageDependencyInfo(const tizen_base::Database& db,
         .Bind(dep->required_version);
 
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1383,7 +1383,7 @@ int InsertAppLocalizedInfo(const tizen_base::Database& db,
         .Bind(label)
         .Bind(icon);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
 
@@ -1423,7 +1423,7 @@ int InsertAppResControl(const tizen_base::Database& db,
         .Bind(rc->max_res_version)
         .Bind(rc->auto_close);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1451,7 +1451,7 @@ int InsertPackagePrivilegeInfo(const tizen_base::Database& db, manifest_x* mfx)
         .Bind(priv->value)
         .Bind(priv->type);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1485,7 +1485,7 @@ int InsertAppDataControlPrivilegeInfo(const tizen_base::Database& db,
         .Bind(priv)
         .Bind(datacontrol->type);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1551,7 +1551,7 @@ int InsertCategoryInfo(const tizen_base::Database& db, application_x* app) {
         .Bind(category);
 
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
   }
@@ -1662,7 +1662,7 @@ int InsertAppcontrolInfo(const tizen_base::Database& db, application_x* app) {
         .Bind(ac->visibility)
         .Bind(ac->id);
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
 
@@ -1764,7 +1764,7 @@ int InsertPackageResInfoAllowedPackage(const tizen_base::Database& db,
           .Bind(nullptr);
 
       if (!db.Exec(q, r)) {
-        _LOGE("db.Exec() failed");
+        _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
         return -1;
       }
 
@@ -1779,7 +1779,7 @@ int InsertPackageResInfoAllowedPackage(const tizen_base::Database& db,
           .Bind(reinterpret_cast<char*>(priv_list->data));
 
       if (!db.Exec(q, r)) {
-        _LOGE("db.Exec() failed");
+        _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
         return -1;
       }
     }
@@ -1941,7 +1941,7 @@ int InsertApplicationInfo(const tizen_base::Database& db, manifest_x *mfx) {
         .Bind(mfx->light_user_switch_mode);
 
     if (!db.Exec(q, r)) {
-      _LOGE("db.Exec() failed");
+      _LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
       return -1;
     }
 
@@ -2225,8 +2225,10 @@ int GetQueryResult(const tizen_base::Database& db,
   }
 
   auto r = db.Exec(q);
-  if (!r)
+  if (!r) {
+    LOGE("db.Exec() failed : %s", static_cast<const char*>(r));
     return PMINFO_R_ERROR;
+  }
 
   int col_cnt = r.GetColumnCount();
   for (const auto& row : r) {