diff mbox series

[BlueZ,v3,4/4] device: Add user-readable messages for a number of errors

Message ID 20250520132733.1746996-4-hadess@hadess.net
State New
Headers show
Series [BlueZ,v3,1/4] client: Add client-side error decoding | expand

Commit Message

Bastien Nocera May 20, 2025, 1:26 p.m. UTC
---
 src/device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 0797e5ff5bb8..d1023f762474 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1922,9 +1922,9 @@  void device_request_disconnect(struct btd_device *device, DBusMessage *msg)
 		DBusMessage *reply;
 
 		if (device->bonding_status == MGMT_STATUS_AUTH_FAILED)
-			err_str = ERR_BREDR_CONN_KEY_MISSING;
+			err_str = ":" ERR_BREDR_CONN_KEY_MISSING ":Link key missing";
 		else
-			err_str = ERR_BREDR_CONN_CANCELED;
+			err_str = ":" ERR_BREDR_CONN_CANCELED ":Connection canceled";
 		reply = btd_error_failed(device->connect, err_str);
 		g_dbus_send_message(dbus_conn, reply);
 		dbus_message_unref(device->connect);
@@ -2545,7 +2545,8 @@  static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 
 	if (!btd_adapter_get_powered(dev->adapter)) {
 		return btd_error_not_ready_str(msg,
-					ERR_BREDR_CONN_ADAPTER_NOT_POWERED);
+					":" ERR_BREDR_CONN_ADAPTER_NOT_POWERED
+					":Adapter not powered");
 	}
 
 	btd_device_set_temporary(dev, false);
@@ -2564,7 +2565,8 @@  static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
 				return dbus_message_new_method_return(msg);
 			} else {
 				return btd_error_not_available_str(msg,
-					ERR_BREDR_CONN_PROFILE_UNAVAILABLE);
+					":" ERR_BREDR_CONN_PROFILE_UNAVAILABLE ":"
+					"Exhausted the list of BR/EDR profiles to connect to");
 			}
 		}