From 9548df2ce95cee1942f615b6f2abf0029e680f5a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 13 Jun 2005 15:36:31 +0000 Subject: 2005-06-13 Ross Burton . * glib/dbus-gobject.c: Handle errors on message demarshalling by sending error message back. * glib/dbus-gvalue.c: Initialize return variables. --- glib/dbus-gobject.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'glib/dbus-gobject.c') diff --git a/glib/dbus-gobject.c b/glib/dbus-gobject.c index e2645f41..311f6b54 100644 --- a/glib/dbus-gobject.c +++ b/glib/dbus-gobject.c @@ -772,7 +772,8 @@ invoke_object_method (GObject *object, guint n_params; const GType *types; DBusGValueMarshalCtx context; - + GError *error = NULL; + context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection); context.proxy = NULL; @@ -780,12 +781,16 @@ invoke_object_method (GObject *object, n_params = types_array->len; types = (const GType*) types_array->data; - value_array = dbus_gvalue_demarshal_message (&context, message, n_params, types, NULL); + value_array = dbus_gvalue_demarshal_message (&context, message, n_params, types, &error); if (value_array == NULL) { g_free (in_signature); g_array_free (types_array, TRUE); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + reply = dbus_message_new_error (message, "org.freedesktop.DBus.GLib.ErrorError", error->message); + dbus_connection_send (connection, reply, NULL); + dbus_message_unref (reply); + g_error_free (error); + return DBUS_HANDLER_RESULT_HANDLED; } g_array_free (types_array, TRUE); } -- cgit