diff options
author | Dan Williams <dcbw@redhat.com> | 2011-05-31 11:25:59 -0500 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-06-01 11:42:47 +0100 |
commit | e8a4f0496d0eec10fc9c76e0ef20e761bb2256c6 (patch) | |
tree | 2876943543d03606036dde796d5c23a8f05cb1e7 /dbus/dbus-gobject.c | |
parent | eeb1c50aa03a95c39487e9331107142f27412958 (diff) |
Log error message from failed object registration
See https://bugzilla.redhat.com/show_bug.cgi?id=708686 for a case of this; it
would be extremely helpful to figure out what the error actually was since it
appears not to be a double-registration or other such issues after inspection
of nm-applet and libnm-glib.
Reviewed-by: Colin Walters <walters@verbum.org>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37795
Diffstat (limited to 'dbus/dbus-gobject.c')
-rw-r--r-- | dbus/dbus-gobject.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index 20c0bba..2d00988 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -2580,6 +2580,7 @@ dbus_g_connection_register_g_object (DBusGConnection *connection, ObjectExport *oe; GSList *iter; ObjectRegistration *o; + DBusError error; g_return_if_fail (connection != NULL); g_return_if_fail (g_variant_is_object_path (at_path)); @@ -2630,12 +2631,16 @@ dbus_g_connection_register_g_object (DBusGConnection *connection, o = object_registration_new (connection, at_path, oe); - if (!dbus_connection_register_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (connection), - at_path, - &gobject_dbus_vtable, - o)) + dbus_error_init (&error); + if (!dbus_connection_try_register_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (connection), + at_path, + &gobject_dbus_vtable, + o, + &error)) { - g_error ("Failed to register GObject with DBusConnection"); + g_error ("Failed to register GObject with DBusConnection: %s %s", + error.name, error.message); + dbus_error_free (&error); object_registration_free (o); return; } |