[gjs: 1/2] [dbus] Include service name in error messages



commit 24ad2010351f694e33c8b121910e0b26c93a73d6
Author: Johan Dahlin <jdahlin litl com>
Date:   Sun Feb 7 22:33:52 2010 -0200

    [dbus] Include service name in error messages
    
    Make it easier to track down when a service is not started.
    
    Got error starting service: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    
    turns into:
    
    Got error starting service 'com.litl.Gecko': org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=609312

 gjs-dbus/dbus.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/gjs-dbus/dbus.c b/gjs-dbus/dbus.c
index d539939..34e336f 100644
--- a/gjs-dbus/dbus.c
+++ b/gjs-dbus/dbus.c
@@ -1119,19 +1119,21 @@ _gjs_dbus_set_matching_name_owner_changed(DBusConnection *connection,
 static void
 on_start_service_reply(GjsDBusProxy    *proxy,
                        DBusMessage     *message,
-                       void            *data)
+                       char            *name)
 {
-    gjs_debug(GJS_DEBUG_DBUS, "Got successful reply to service start");
+    gjs_debug(GJS_DEBUG_DBUS, "Got successful reply to service '%s' start", name);
+    g_free(name);
 }
 
 static void
 on_start_service_error(GjsDBusProxy    *proxy,
                        const char      *error_name,
                        const char      *error_message,
-                       void            *data)
+                       char            *name)
 {
-    gjs_debug(GJS_DEBUG_DBUS, "Got error starting service: %s: %s",
-            error_name, error_message);
+    gjs_debug(GJS_DEBUG_DBUS, "Got error starting service '%s': %s: %s",
+            name, error_name, error_message);
+    g_free(name);
 }
 
 void
@@ -1157,9 +1159,9 @@ gjs_dbus_start_service(DBusConnection *connection,
                                  DBUS_TYPE_INVALID)) {
         gjs_dbus_proxy_send(info->driver_proxy,
                             message,
-                            on_start_service_reply,
-                            on_start_service_error,
-                            NULL);
+                            (GjsDBusProxyReplyFunc)on_start_service_reply,
+                            (GjsDBusProxyErrorReplyFunc)on_start_service_error,
+                            g_strdup(name));
     } else {
         gjs_debug(GJS_DEBUG_DBUS, "No memory appending args to StartServiceByName");
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]