From 926dfd08b8af7b71f9a1a55f318c79560a606ff3 Mon Sep 17 00:00:00 2001 From: taesub kim Date: Wed, 9 Aug 2017 17:51:37 +0900 Subject: [PATCH] Added dbus error register for dbus error invocation E/WIFI_MANAGER( 1241): network_interface.c: net_config_get_id_list(2780) > Failed to get config id list. Error [NET_ERR_UNKNOWN] E/WIFI_MANAGER( 1241): wifi_internal.c: _wifi_load_configurations(2144) > Fail to load configurations [-30277631] E/WIFI_MANAGER( 1241): wifi_config.c: wifi_manager_config_foreach_configuration(236) > Fail to load configurations [-3027763 Change-Id: Idd0658b61fcbda631a287ee77bee4094dd8fd3db Signed-off-by: Taesub Kim --- src/neterror.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++--------- src/wifi-config.c | 2 +- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/src/neterror.c b/src/neterror.c index bcec816..24167a0 100755 --- a/src/neterror.c +++ b/src/neterror.c @@ -172,14 +172,59 @@ void netconfig_error_dbus_method_return(GDBusMethodInvocation *context, netconfi void netconfig_error_init(void) { - /* TODO: register GError domain to make error_name */ - /* - dbus_g_error_domain_register(NETCONFIG_ERROR_QUARK, - NETCONFIG_ERROR_INTERFACE, - code_num_netconfig); - - dbus_g_error_domain_register(NETCONFIG_CONNMAN_AGENT_ERROR_QUARK, - CONNMAN_AGENT_ERROR_INTERFACE, - code_num_connman); - */ + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_INTERNAL, + "net.netconfig.Error.Internal"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_NO_SERVICE, + "net.netconfig.Error.NoService"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_NO_PROFILE, + "net.netconfig.Error.NoProfile"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_WRONG_PROFILE, + "net.netconfig.Error.WrongProfile"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_INPROGRESS, + "net.netconfig.Error.InProgress"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_ALREADYEXISTS, + "net.netconfig.Error.AlreadyExists"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_INVALID_PARAMETER, + "net.netconfig.Error.InvalidParameter"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_PERMISSION_DENIED, + "net.netconfig.Error.PermissionDenied"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_WIFI_DRIVER_FAILURE, + "net.netconfig.Error.WifiDriverFailed"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_FAILED_GET_IMSI, + "net.netconfig.Error.FailGetSimImsi"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH, + "net.netconfig.Error.FailReqSimAuthWrongParam"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_FAILED_REQ_SIM_AUTH_WRONG_PARAM, + "net.netconfig.Error.FailReqSimAuthWrongParam"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_WRONG_DATA, + "net.netconfig.Error.FailGetSimAuthWrongData"); + + g_dbus_error_register_error(NETCONFIG_ERROR_QUARK, + NETCONFIG_ERROR_FAILED_GET_SIM_AUTH_DELAY, + "net.netconfig.Error.FailGetSimAuthDelay"); } diff --git a/src/wifi-config.c b/src/wifi-config.c index 84a64a6..afa0382 100755 --- a/src/wifi-config.c +++ b/src/wifi-config.c @@ -915,8 +915,8 @@ gboolean handle_get_config_ids(Wifi *wifi, GDBusMethodInvocation *context) config_ids = _get_list(); if (config_ids == NULL) { - netconfig_error_no_profile(context); ERR("Fail to get config list"); + netconfig_error_no_profile(context); return FALSE; } -- 2.7.4