diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-02-26 16:24:07 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-02-26 16:24:07 +0000 |
commit | a7f1185d9a36357f9d32c23d2f27ac6031dc1b08 (patch) | |
tree | 67e3b1ff930af9546c9a47832ca7b7096d3bd0e7 /hcid/dbus-error.c | |
parent | eaf7c01776d820bad2b306ffefd93362b3194522 (diff) |
First update to new error messages
Diffstat (limited to 'hcid/dbus-error.c')
-rw-r--r-- | hcid/dbus-error.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c index df8913ad..88e5bd7f 100644 --- a/hcid/dbus-error.c +++ b/hcid/dbus-error.c @@ -156,3 +156,22 @@ DBusMessage *bluez_new_failure_msg(DBusMessage *msg, const uint32_t ecode) return reply; } + +DBusMessage *error_generic(DBusMessage *msg, int err) +{ + const char *str = strerror(err); + + return dbus_message_new_error(msg, ERROR_INTERFACE ".UnknownError", str); +} + +DBusMessage *error_out_of_memory(DBusMessage *msg) +{ + return dbus_message_new_error(msg, ERROR_INTERFACE ".OutOfMemory", + "Out of memory"); +} + +DBusMessage *error_no_such_device(DBusMessage *msg) +{ + return dbus_message_new_error(msg, ERROR_INTERFACE ".NoSuchDevice", + "No such device"); +} |