mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 05:34:23 +08:00
convert errors to btd_error_does_not_exist()
This commit is contained in:
parent
09be5d6efa
commit
3df548164d
@ -522,9 +522,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn,
|
||||
return btd_error_invalid_args(msg);
|
||||
|
||||
if (strcmp(gw->agent->path, path) != 0)
|
||||
return g_dbus_create_error(msg,
|
||||
ERROR_INTERFACE ".Failed",
|
||||
"Unknown object path");
|
||||
return btd_error_does_not_exist(msg);
|
||||
|
||||
g_dbus_remove_watch(device->conn, gw->agent->watch);
|
||||
|
||||
|
@ -351,8 +351,7 @@ static DBusMessage *unregister_endpoint(DBusConnection *conn, DBusMessage *msg,
|
||||
|
||||
endpoint = media_adapter_find_endpoint(adapter, sender, path, NULL);
|
||||
if (endpoint == NULL)
|
||||
return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
|
||||
"Endpoint not registered");
|
||||
return btd_error_does_not_exist(msg);
|
||||
|
||||
media_endpoint_remove(endpoint);
|
||||
|
||||
|
@ -600,7 +600,7 @@ static DBusMessage *request_authorization(DBusConnection *conn,
|
||||
|
||||
sender = dbus_message_get_sender(msg);
|
||||
if (find_pending_by_sender(serv_adapter, sender))
|
||||
return failed(msg);
|
||||
return btd_error_does_not_exist(msg);
|
||||
|
||||
user_record = find_record(serv_adapter, handle, sender);
|
||||
if (!user_record) {
|
||||
|
@ -723,9 +723,7 @@ static DBusMessage *cancel_discover(DBusConnection *conn,
|
||||
const char *requestor;
|
||||
|
||||
if (!device->browse)
|
||||
return g_dbus_create_error(msg,
|
||||
ERROR_INTERFACE ".Failed",
|
||||
"No pending discovery");
|
||||
return btd_error_does_not_exist(msg);
|
||||
|
||||
if (!dbus_message_is_method_call(device->browse->msg, DEVICE_INTERFACE,
|
||||
"DiscoverServices"))
|
||||
|
Loading…
Reference in New Issue
Block a user