Commit 12ce8577 authored by Zeeshan Ali's avatar Zeeshan Ali

Correct error throwing/sending

g_dbus_method_invocation_return_dbus_error expects names of valid
*registered* errors, not just some arbitrary strings.
parent 6fb4972a
......@@ -133,16 +133,19 @@ gclue_service_client_handle_start (GClueClient *client,
if (strcmp (g_dbus_method_invocation_get_sender (invocation),
GCLUE_SERVICE_CLIENT (client)->priv->peer) != 0) {
g_dbus_method_invocation_return_dbus_error (invocation,
"Access denied",
"Access denied");
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_ACCESS_DENIED,
"Access denied");
return TRUE;
}
if (!update_location (GCLUE_SERVICE_CLIENT (client), &error)) {
g_dbus_method_invocation_return_dbus_error (invocation,
"Failed to update location info",
error->message);
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Failed to update location info: %s",
error->message);
return TRUE;
}
......@@ -158,9 +161,10 @@ gclue_service_client_handle_stop (GClueClient *client,
{
if (strcmp (g_dbus_method_invocation_get_sender (invocation),
GCLUE_SERVICE_CLIENT (client)->priv->peer) != 0) {
g_dbus_method_invocation_return_dbus_error (invocation,
"Access denied",
"Access denied");
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_ACCESS_DENIED,
"Access denied");
return TRUE;
}
......
......@@ -77,9 +77,10 @@ gclue_service_manager_handle_get_client (GClueServiceManager *manager,
peer = g_dbus_method_invocation_get_sender (invocation);
client = gclue_service_client_new (peer, path, priv->connection, &error);
if (error != NULL) {
g_dbus_method_invocation_return_dbus_error (invocation,
"Object registration failure",
error->message);
g_dbus_method_invocation_return_error (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
error->message);
return TRUE;
}
......
Markdown is supported
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