Previously, AT-SPI would wind up passing a NULL connection to libdbus if it
couldn't connect to the bus, causing a cryptic abort. This change makes it
at least abort with a sensible error message in that case.
Also, if unable to find the accessibility bus address via the session bus,
save and print the DBusError, if any.
{
if (!bus)
atspi_init ();
+ if (!bus)
+ g_error ("AT-SPI: COuldn't connect to accessibility bus. Is at-spi-bus-launcher running?");
return bus;
}
DBusConnection *session_bus = NULL;
DBusMessage *message;
DBusMessage *reply;
+ DBusError error;
char *address = NULL;
session_bus = dbus_bus_get (DBUS_BUS_SESSION, NULL);
"org.a11y.Bus",
"GetAddress");
+ dbus_error_init (&error);
reply = dbus_connection_send_with_reply_and_block (session_bus,
message,
-1,
- NULL);
+ &error);
dbus_message_unref (message);
if (!reply)
+ {
+ g_warning ("Error retrieving accessibility bus address: %s: %s",
+ error.name, error.message);
+ dbus_error_init (&error);
return NULL;
+ }
{
const char *tmp_address;