Added dbus error register for dbus error invocation 20/143320/6 accepted/tizen/unified/20170811.133328 submit/tizen/20170811.041528
authortaesub kim <taesub.kim@samsung.com>
Wed, 9 Aug 2017 08:51:37 +0000 (17:51 +0900)
committertaesub kim <taesub.kim@samsung.com>
Thu, 10 Aug 2017 06:40:45 +0000 (15:40 +0900)
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 <taesub.kim@samsung.com>
src/neterror.c
src/wifi-config.c

index bcec816..24167a0 100755 (executable)
@@ -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");
 }
index 84a64a6..afa0382 100755 (executable)
@@ -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;
        }