diff options
author | Dan Williams <dcbw@redhat.com> | 2008-11-19 15:09:05 +0000 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2008-11-19 15:09:05 +0000 |
commit | 3c2d8253ec19ac1659c0b8f6981efd971315779c (patch) | |
tree | ab4b7470b33c20674c99c482ba1eb772d6d771dd /libnm-glib | |
parent | 68a2fc9739fd5468bb235e920fd92dcf8f893be1 (diff) | |
download | NetworkManager-3c2d8253ec19ac1659c0b8f6981efd971315779c.tar.gz |
2008-11-19 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-connection.c
libnm-util/nm-connection.h
- (nm_connection_replace_settings): take a GError
* libnm-glib/nm-settings.c
libnm-glib/nm-dbus-connection.c
src/nm-manager.c
system-settings/plugins/ifcfg-suse/nm-suse-connection.c
system-settings/plugins/keyfile/nm-keyfile-connection.c
system-settings/plugins/keyfile/plugin.c
- Handle, or don't handle, errors from nm_connection_replace_settings()
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4298 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'libnm-glib')
-rw-r--r-- | libnm-glib/nm-dbus-connection.c | 12 | ||||
-rw-r--r-- | libnm-glib/nm-settings.c | 13 |
2 files changed, 21 insertions, 4 deletions
diff --git a/libnm-glib/nm-dbus-connection.c b/libnm-glib/nm-dbus-connection.c index f027b0a272..631ee3c871 100644 --- a/libnm-glib/nm-dbus-connection.c +++ b/libnm-glib/nm-dbus-connection.c @@ -94,12 +94,20 @@ connection_updated_cb (DBusGProxy *proxy, GHashTable *settings, gpointer user_da { NMExportedConnection *exported = NM_EXPORTED_CONNECTION (user_data); NMConnection *wrapped; + GError *error = NULL; wrapped = nm_exported_connection_get_connection (exported); - if (nm_connection_replace_settings (wrapped, settings)) + if (nm_connection_replace_settings (wrapped, settings, &error)) nm_exported_connection_signal_updated (exported, settings); - else + else { + g_warning ("%s: '%s' / '%s' invalid: %d", + __func__, + error ? g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)) : "(none)", + (error && error->message) ? error->message : "(none)", + error ? error->code : -1); + g_clear_error (&error); nm_exported_connection_signal_removed (exported); + } } static void diff --git a/libnm-glib/nm-settings.c b/libnm-glib/nm-settings.c index ab860f9ddf..34516b766b 100644 --- a/libnm-glib/nm-settings.c +++ b/libnm-glib/nm-settings.c @@ -524,6 +524,7 @@ nm_exported_connection_update (NMExportedConnection *connection, GError **err) { gboolean success = TRUE; + GError *error = NULL; g_return_val_if_fail (NM_IS_EXPORTED_CONNECTION (connection), FALSE); g_return_val_if_fail (new_settings != NULL, FALSE); @@ -532,8 +533,16 @@ nm_exported_connection_update (NMExportedConnection *connection, success = EXPORTED_CONNECTION_CLASS (connection)->update (connection, new_settings, err); if (success) { - nm_connection_replace_settings (NM_EXPORTED_CONNECTION_GET_PRIVATE (connection)->wrapped, new_settings); - nm_exported_connection_signal_updated (connection, new_settings); + if (!nm_connection_replace_settings (NM_EXPORTED_CONNECTION_GET_PRIVATE (connection)->wrapped, new_settings, &error)) { + g_warning ("%s: '%s' / '%s' invalid: %d", + __func__, + error ? g_type_name (nm_connection_lookup_setting_type_by_quark (error->domain)) : "(none)", + (error && error->message) ? error->message : "(none)", + error ? error->code : -1); + g_clear_error (&error); + success = FALSE; + } else + nm_exported_connection_signal_updated (connection, new_settings); } return success; |