[PATCH 2/2] bluetooth: When receiving D-Bus errors, print also the error message.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---

The first hunk contains a possibly controversial change:
earlier the log message was skipped if the error was
DBUS_ERROR_UNKNOWN_METHOD, and now it's not skipped
anymore. I removed the check, because I didn't see any
reason for it, but maybe I'm missing something. I haven't
yet tested this patch in practice either.


 src/modules/bluetooth/bluetooth-util.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index c5befe3..15c544e 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -438,10 +438,7 @@ static void get_properties_reply(DBusPendingCall *pending, void *userdata) {
     }
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-
-        if (!dbus_message_is_error(r, DBUS_ERROR_UNKNOWN_METHOD))
-            pa_log("Error from GetProperties reply: %s", dbus_message_get_error_name(r));
-
+        pa_log("%s.GetProperties() failed: %s: %s", dbus_message_get_interface(p->message), dbus_message_get_error_name(r), pa_dbus_get_error_message(r));
         goto finish;
     }
 
@@ -548,7 +545,7 @@ static void register_endpoint_reply(DBusPendingCall *pending, void *userdata) {
     }
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-        pa_log("Error from RegisterEndpoint reply: %s", dbus_message_get_error_name(r));
+        pa_log("org.bluez.Media.RegisterEndpoint() failed: %s: %s", dbus_message_get_error_name(r), pa_dbus_get_error_message(r));
         goto finish;
     }
 
@@ -584,7 +581,7 @@ static void list_devices_reply(DBusPendingCall *pending, void *userdata) {
     }
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-        pa_log("Error from ListDevices reply: %s", dbus_message_get_error_name(r));
+        pa_log("org.bluez.Adapter.ListDevices() failed: %s: %s", dbus_message_get_error_name(r), pa_dbus_get_error_message(r));
         goto finish;
     }
 
@@ -689,7 +686,7 @@ static void list_adapters_reply(DBusPendingCall *pending, void *userdata) {
     }
 
     if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
-        pa_log("Error from ListAdapters reply: %s", dbus_message_get_error_name(r));
+        pa_log("org.bluez.Manager.ListAdapters() failed: %s: %s", dbus_message_get_error_name(r), pa_dbus_get_error_message(r));
         goto finish;
     }
 
-- 
1.7.7.3



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux