diff options
author | Dan Winship <danw@gnome.org> | 2014-10-16 16:51:22 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-10-22 08:29:10 -0400 |
commit | da8d79f1c5f7d9c34610ebf82fe2328678cb4169 (patch) | |
tree | 72c920d7732692287779e7c499975fcc16f8e835 /src/nm-dcb.c | |
parent | 388a0c5e784b4babd80b57f8a66250bd3db37262 (diff) | |
download | NetworkManager-da8d79f1c5f7d9c34610ebf82fe2328678cb4169.tar.gz |
core: drop all remaining core-internal error domains
A number of classes in core had their own error domains that aren't
really necessary.
In the case of NMDcbError, NMDhcpManagerError, NMDnsManagerError,
NMDnsmasqManagerError, NMPppManagerError, and NMSessionMonitorError,
most of the codes they defined weren't even being used, and at any
rate, the errors were always returned into contexts where they would
just have their message extracted and then get thrown away without
anyone ever looking at the domain or code. So all uses of those
domains can just be replaced with NM_MANAGER_ERROR_FAILED without any
loss of information.
NMAuthManagerError only had 1 error code, and it just indicated
"something went wrong", so it can be replaced with
NM_MANAGER_ERROR_FAILED without loss of information.
(nm-auth-manager.c has also been fixed to return
NM_MANAGER_ERROR_FAILED when the CheckAuthorization D-Bus call fails,
rather than returning whatever error domain/code the D-Bus call
returned.)
NMVpnManagerError used 2 of its 4 error codes, and they could actually
end up getting returned across D-Bus in some cases. But there are
NMManagerError codes that are semantically similar enough to make the
NMVpnManagerError ones unnecessary.
Diffstat (limited to 'src/nm-dcb.c')
-rw-r--r-- | src/nm-dcb.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/nm-dcb.c b/src/nm-dcb.c index 3829e1a2e9..3dfa306c4c 100644 --- a/src/nm-dcb.c +++ b/src/nm-dcb.c @@ -29,16 +29,6 @@ #include "nm-posix-signals.h" #include "nm-logging.h" -GQuark -nm_dcb_error_quark (void) -{ - static GQuark ret = 0; - - if (ret == 0) - ret = g_quark_from_static_string ("nm-dcb-error"); - return ret; -} - static const char *helper_names[] = { "dcbtool", "fcoeadm" }; gboolean @@ -63,7 +53,7 @@ do_helper (const char *iface, split = g_strsplit_set (cmdline, " ", 0); if (!split) { - g_set_error (error, NM_DCB_ERROR, NM_DCB_ERROR_INTERNAL, + g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED, "failure parsing %s command line", helper_names[which]); goto out; } @@ -327,7 +317,7 @@ run_helper (char **argv, guint which, gpointer user_data, GError **error) if (ignore_error == FALSE) { nm_log_warn (LOGD_DCB, "'%s' failed: '%s'", cmdline, (errmsg && strlen (errmsg)) ? errmsg : outmsg); - g_set_error (error, NM_DCB_ERROR, NM_DCB_ERROR_HELPER_FAILED, + g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED, "Failed to run '%s'", cmdline); success = FALSE; } |