From 6557deeed871651d6a7f395e74808355979cf9cd Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 28 Mar 2011 17:30:29 +0100 Subject: [PATCH 20/25] dbus_g_proxy_marshal_args_to_message: diagnose inability to marshal args Failure to marshal arguments is entirely reachable, albeit only via programming error. --- dbus/dbus-gproxy.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c index 3270618..8c2034f 100644 --- a/dbus/dbus-gproxy.c +++ b/dbus/dbus-gproxy.c @@ -2166,7 +2166,7 @@ dbus_g_proxy_marshal_args_to_message (DBusGProxy *proxy, priv->interface, method); if (message == NULL) - goto oom; + return NULL; dbus_message_iter_init_append (message, &msgiter); for (i = 0; i < args->n_values; i++) @@ -2176,11 +2176,19 @@ dbus_g_proxy_marshal_args_to_message (DBusGProxy *proxy, gvalue = g_value_array_get_nth (args, i); if (!_dbus_gvalue_marshal (&msgiter, gvalue)) - g_assert_not_reached (); + { + /* This is a programming error by the caller, most likely */ + gchar *contents = g_strdup_value_contents (gvalue); + + g_critical ("Could not marshal argument %u for %s: type %s, value %s", + i, method, G_VALUE_TYPE_NAME (gvalue), contents); + g_free (contents); + dbus_message_unref (message); + return NULL; + } } + return message; - oom: - return NULL; } static guint -- 1.7.4.1