summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-15 15:55:39 +0100
committerSimon McVittie <smcv@collabora.com>2018-12-03 15:12:07 +0000
commit850459e0793e3bb1d3ca6a1c51735fa195ccc4f8 (patch)
treee5b023f0d2c62e195c6df631ac8a99ae745321cb
parent0e4c62b0000640ab46adc02bc4f774454bace4ad (diff)
downloaddbus-glib-850459e0793e3bb1d3ca6a1c51735fa195ccc4f8.tar.gz
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. Signed-off-by: Simon McVittie <smcv@collabora.com> Resolves: https://gitlab.freedesktop.org/dbus/dbus-glib/issues/1
-rw-r--r--dbus/dbus-gobject.c2
-rw-r--r--test/core/test-variant-recursion.c3
-rw-r--r--test/core/unsupported-type.c6
3 files changed, 2 insertions, 9 deletions
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c
index 977c012..8d06723 100644
--- a/dbus/dbus-gobject.c
+++ b/dbus/dbus-gobject.c
@@ -1788,7 +1788,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 507ea4d..8278d9f 100644
--- a/test/core/test-variant-recursion.c
+++ b/test/core/test-variant-recursion.c
@@ -92,8 +92,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);