distribute_method_call (GDBusConnection *connection,
GDBusMessage *message)
{
+ GDBusMessage *reply;
ExportedObject *eo;
ExportedSubtree *es;
const gchar *object_path;
if (handle_generic_unlocked (connection, message))
goto out;
- /* if we end up here, the message has not been not handled */
+ /* if we end up here, the message has not been not handled - so return an error saying this */
+ reply = g_dbus_message_new_method_error (message,
+ "org.freedesktop.DBus.Error.UnknownMethod",
+ _("No such interface `%s' on object at path %s"),
+ interface_name,
+ object_path);
+ g_dbus_connection_send_message_unlocked (connection, reply, NULL, NULL);
+ g_object_unref (reply);
out:
g_free (subtree_path);
g_error_free (error);
g_assert (value == NULL);
+ error = NULL;
+ value = g_dbus_proxy_call_sync (foo_proxy,
+ "org.example.FooXYZ.NonExistant",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+ g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
+ g_error_free (error);
+ g_assert (value == NULL);
+
/* user properties */
error = NULL;
value = g_dbus_proxy_call_sync (foo_proxy,