#include "cert_get_db_handler.hh"
+#include "pkgmgrinfo_debug.h"
#include "pkgmgrinfo_internal.h"
namespace pkgmgr_common {
int CertGetDBHandler::Execute() {
SetOpType(OPERATION_TYPE_READ);
SetDBType(DB_TYPE_FILE_CERTDB);
- if (!Connect())
+ if (!Connect()) {
+ _LOGE("Failed to connect database");
return PMINFO_R_ERROR;
+ }
pkgmgrinfo_certinfo_h handle;
int ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
#include "depinfo_db_handler.hh"
+#include "pkgmgrinfo_debug.h"
#include "pkgmgrinfo_internal.h"
namespace pkgmgr_common {
SetOpType(OPERATION_TYPE_READ);
SetDBType(DB_TYPE_FILE_PKGDB);
- if (!Connect()) return PMINFO_R_ERROR;
+ if (!Connect()) {
+ _LOGE("Failed to connect database");
+ return PMINFO_R_ERROR;
+ }
GList *list = nullptr;
int ret = pkginfo_internal_filter_get_depends_on(
GetConnection(), pkgid_.c_str(), &list);
#include "pkg_get_db_handler.hh"
+#include "pkgmgrinfo_debug.h"
#include "pkgmgrinfo_internal.h"
namespace {
int PkgGetDBHandler::Execute() {
SetOpType(OPERATION_TYPE_READ);
SetDBType(DB_TYPE_FILE_PKGDB);
- if (!Connect()) return PMINFO_R_ERROR;
+ if (!Connect()) {
+ _LOGE("Failed to connect database");
+ return PMINFO_R_ERROR;
+ }
// TODO: db handle should be delivered
GHashTable* list;
#include "db_handle_provider.hh"
#include "pkg_set_db_handler.hh"
+#include "pkgmgrinfo_debug.h"
#include "pkgmgr_parser_db.h"
namespace pkgmgr_common {
} else if (write_type_ == Delete) {
ret = pkgmgr_parser_delete_pkg_info(GetConnection(), package_->package, uid_);
} else {
-
+ _LOGE("Unknown db write type");
}
if (ret != PM_PARSER_R_OK) {
#include "query_handler.hh"
+#include "pkgmgrinfo_debug.h"
#include "pkgmgrinfo_internal.h"
namespace pkgmgr_common {
}
int QueryHandler::Execute() {
- if (!Connect()) return PMINFO_R_ERROR;
+ if (!Connect()) {
+ _LOGE("Failed to connect database");
+ return PMINFO_R_ERROR;
+ }
- // TODO: db handle should be delivered
GList* list =nullptr;
int row = 0;
int col = 0;
- if (query_.size() == 0)
+ if (query_.size() == 0) {
+ _LOGE("Empty query");
return PMINFO_R_ERROR;
+ }
if (GetOpType() == OPERATION_TYPE_READ) {
int ret = get_query_result(GetConnection(), query_[0].c_str(), &list, &row, &col);
if (ret != PMINFO_R_OK) {
- // TODO: error log
+ _LOGE("Failed to execute query");
return ret;
}
return ret;
} else {
const char **queries = (const char **)calloc(query_.size(), sizeof(char *));
- if (queries == nullptr)
+ if (queries == nullptr) {
+ _LOGE("Out of memory");
return PMINFO_R_ERROR;
+ }
int i = 0;
for (const auto& query : query_)