From ec13cfc9167a212aa2cbb091f26afca6ca0c6360 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 15 Sep 2014 15:55:39 +0100 Subject: [PATCH 3/3] invoke_object_method: when demarshalling fails, use the right error This replaces the inappropriate org.freedesktop.DBus.GLib.ErrorError with the intended error codes, affecting two tests. --- dbus/dbus-gobject.c | 2 +- test/core/test-variant-recursion.c | 3 +-- test/core/unsupported-type.c | 6 ------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index ddfb6be..a206062 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1781,7 +1781,7 @@ invoke_object_method (GObject *object, { g_free (in_signature); g_array_free (types_array, TRUE); - reply = error_or_die (message, "org.freedesktop.DBus.GLib.ErrorError", error->message); + reply = gerror_to_dbus_error_message (object_info, message, error); connection_send_or_die (connection, reply); dbus_message_unref (reply); g_error_free (error); diff --git a/test/core/test-variant-recursion.c b/test/core/test-variant-recursion.c index 8a2d36f..82618d6 100644 --- a/test/core/test-variant-recursion.c +++ b/test/core/test-variant-recursion.c @@ -91,8 +91,7 @@ main (int argc, char **argv) /* More than the current internal limit (16) */ if (make_recursive_stringify_call (50, proxy, &error)) g_error ("Unexpected success code from 50 recursive variant call: %s", error->message); - if (error->code != DBUS_GERROR_REMOTE_EXCEPTION) - g_error ("Error code was not remote exception: %s", error->message); + g_assert_error (error, DBUS_GERROR, DBUS_GERROR_NO_MEMORY); g_printerr ("Got expected error %d: \"%s\" from recursive variant call\n", error->code, error->message); g_clear_error (&error); diff --git a/test/core/unsupported-type.c b/test/core/unsupported-type.c index f8dca7c..d8e397b 100644 --- a/test/core/unsupported-type.c +++ b/test/core/unsupported-type.c @@ -197,15 +197,9 @@ test_call (Fixture *f, dbus_pending_call_unref (pc); /* it didn't work */ -#if 0 /* this is what it should be */ g_assert_cmpstr (dbus_message_get_error_name (reply), ==, DBUS_ERROR_INVALID_SIGNATURE); -#else - /* this is what it is right now */ - g_assert_cmpstr (dbus_message_get_error_name (reply), ==, - "org.freedesktop.DBus.GLib.ErrorError"); -#endif /* it didn't call the into the user-supplied C code */ g_assert_cmpuint (MY_OBJECT (f->object)->echo_variant_called, ==, 0); -- 2.1.0