diff mbox series

[BlueZ,v7,4/4] client: Print error code for connect methods

Message ID 20210930153703.BlueZ.v7.4.I226fdcdd12b13e4875c8cd03b42fc52283920cc4@changeid (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series Detailed error string | expand

Checks

Context Check Description
tedd_an/checkpatch fail [BlueZ,v7,4/4] client: Print error code for connect methods\ERROR:MISSING_SIGN_OFF: Missing Signed-off-by: line(s) total: 1 errors, 0 warnings, 9 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/12529437.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/gitlint success Gitlint PASS

Commit Message

Miao-chen Chou Sept. 30, 2021, 10:37 p.m. UTC
The following steps were performed.
- Issuing repeated commands to connect the same BLE device.
- Verifying the print in bluetoothctl console

Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Howard Chung <howardchung@google.com>
---

Changes in v7:
- Fix nits

Changes in v6:
- Rephrase error string

Changes in v5:
- Replace error code with error string

Changes in v4:
- Address make errors.

Changes in v3:
- Correct error-codes.txt.

Changes in v2:
- Add documentation for error codes

 client/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/client/main.c b/client/main.c
index c1a62edb7..61650c289 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1966,7 +1966,8 @@  static void connect_reply(DBusMessage *message, void *user_data)
 	dbus_error_init(&error);
 
 	if (dbus_set_error_from_message(&error, message) == TRUE) {
-		bt_shell_printf("Failed to connect: %s\n", error.name);
+		bt_shell_printf("Failed to connect: %s %s\n", error.name,
+				error.message);
 		dbus_error_free(&error);
 		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 	}