summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlho Kim <ilho159.kim@samsung.com>2024-04-12 12:44:21 +0900
committerIlho Kim <ilho159.kim@samsung.com>2024-04-12 12:47:20 +0900
commit83479a0499c82e3ee5509bedc6498fe339cf2590 (patch)
treebe7da8df944a14e374fe60c25df889af5d8074c7
parent015dd3cd87cb07a074acbeacf73138c248dd2195 (diff)
downloadslp-pkgmgr-83479a0499c82e3ee5509bedc6498fe339cf2590.tar.gz
slp-pkgmgr-83479a0499c82e3ee5509bedc6498fe339cf2590.tar.bz2
slp-pkgmgr-83479a0499c82e3ee5509bedc6498fe339cf2590.zip
Apply try-catch where exception can be occured
Change-Id: Iff694596a649b6e7ddffdb0d7e8b999c057dacbc Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
-rw-r--r--installer/pkgmgr_installer_signal_agent.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/installer/pkgmgr_installer_signal_agent.cc b/installer/pkgmgr_installer_signal_agent.cc
index be1d656..227c3ad 100644
--- a/installer/pkgmgr_installer_signal_agent.cc
+++ b/installer/pkgmgr_installer_signal_agent.cc
@@ -161,11 +161,15 @@ static void __emit_signal_for_res_event(const char* signal, GVariant* gv) {
g_variant_get(extra_param, "(ia(si))", &error_code, &iter);
while (g_variant_iter_loop(iter, "(&si)", &path, &state))
path_info.emplace_back(path, state);
-
- signal_sender->AsyncResultForResource(signal, target_uid, req_id, pkgid, status,
- pkg_signal::ExtraData(error_code, std::move(path_info)));
g_variant_unref(extra_param);
g_variant_iter_free(iter);
+
+ try {
+ signal_sender->AsyncResultForResource(signal, target_uid, req_id, pkgid,
+ status, pkg_signal::ExtraData(error_code, std::move(path_info)));
+ } catch (...) {
+ LOGE("Exception occured");
+ }
}
static void __emit_signal_for_pkg_event(GVariant* gv) {
@@ -184,8 +188,13 @@ static void __emit_signal_for_pkg_event(GVariant* gv) {
std::vector<pkg_signal::PkgInfo> pkgs;
while (g_variant_iter_loop(iter, "(&s&s&s)", &pkgid, &appid, &pkg_type))
pkgs.emplace_back(pkg_signal::PkgInfo(pkgid, appid, pkg_type));
- signal_sender->AsyncResult("", target_uid, req_id, std::move(pkgs), key, val);
g_variant_iter_free(iter);
+
+ try {
+ signal_sender->AsyncResult("", target_uid, req_id, std::move(pkgs), key, val);
+ } catch (...) {
+ LOGE("Exception occured");
+ }
}
static gboolean __quit(gpointer user_data) {