From 948c9b8eae3b10644e878f317bcfca976fe86cdf Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Fri, 15 Dec 2023 16:15:48 +0900 Subject: [PATCH] Add log for add db execution failed Change-Id: I94b2adfbde53c3659e4c7078dcfef4bf83ea49d8 Signed-off-by: Ilho Kim --- src/server/pkginfo_internal.cc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/server/pkginfo_internal.cc b/src/server/pkginfo_internal.cc index 3b79f5c..40492ad 100644 --- a/src/server/pkginfo_internal.cc +++ b/src/server/pkginfo_internal.cc @@ -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(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(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(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(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(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(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(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(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(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(r)); return -1; } @@ -1779,7 +1779,7 @@ int InsertPackageResInfoAllowedPackage(const tizen_base::Database& db, .Bind(reinterpret_cast(priv_list->data)); if (!db.Exec(q, r)) { - _LOGE("db.Exec() failed"); + _LOGE("db.Exec() failed : %s", static_cast(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(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(r)); return PMINFO_R_ERROR; + } int col_cnt = r.GetColumnCount(); for (const auto& row : r) { -- 2.7.4