Commit 850459e0 authored by Simon McVittie's avatar Simon McVittie Committed by Simon McVittie
Browse files

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's avatarSimon McVittie <smcv@collabora.com>
Resolves: dbus/dbus-glib#1
parent 0e4c62b0
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment