3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-18 10:19:24 +01:00

dbus: Add more error reporting functions

Report error for
- invalid dbus arguments
- if object already exists
- if object is not found
This commit is contained in:
Jukka Rissanen 2015-02-24 17:23:19 +02:00 committed by Denis Kenzior
parent 5fb648d9fc
commit 0403be7fee
2 changed files with 21 additions and 0 deletions

View File

@ -102,6 +102,24 @@ struct l_dbus_message *dbus_error_not_available(struct l_dbus_message *msg)
"Operation not available");
}
struct l_dbus_message *dbus_error_invalid_args(struct l_dbus_message *msg)
{
return l_dbus_message_new_error(msg, IWD_SERVICE ".InvalidArgs",
"Argument type is wrong");
}
struct l_dbus_message *dbus_error_already_exists(struct l_dbus_message *msg)
{
return l_dbus_message_new_error(msg, IWD_SERVICE ".AlreadyExists",
"Object already exists");
}
struct l_dbus_message *dbus_error_not_found(struct l_dbus_message *msg)
{
return l_dbus_message_new_error(msg, IWD_SERVICE ".NotFound",
"Object not found");
}
void dbus_pending_reply(struct l_dbus_message **msg,
struct l_dbus_message *reply)
{

View File

@ -50,6 +50,9 @@ struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_aborted(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_not_available(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_invalid_args(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_already_exists(struct l_dbus_message *msg);
struct l_dbus_message *dbus_error_not_found(struct l_dbus_message *msg);
bool dbus_init(bool enable_debug);
bool dbus_exit(void);