From 96125fe2b2ffda8db2ab3dfea38899d818a0b041 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Tue, 13 Feb 2018 10:22:53 +1000 Subject: [PATCH] test/admin_socket_output: better error reporting Signed-off-by: Brad Hubbard --- src/test/admin_socket_output.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test/admin_socket_output.cc b/src/test/admin_socket_output.cc index 89db393f65d4..37bd732a5057 100644 --- a/src/test/admin_socket_output.cc +++ b/src/test/admin_socket_output.cc @@ -108,7 +108,12 @@ AdminSocketOutput::run_command(AdminSocketClient &client, } else { command = "{\"prefix\":\"" + raw_command + "\"}"; } - client.do_request(command, &output); + std::string err = client.do_request(command, &output); + if (!err.empty()) { + std::cerr << __func__ << " AdminSocketClient::do_request errored with: " + << err << std::endl; + ceph_assert(false); + } return std::make_pair(command, output); } @@ -121,7 +126,12 @@ bool AdminSocketOutput::gather_socket_output() { std::cout << std::endl << "Sending request to " << socket << std::endl << std::endl; - client.do_request("{\"prefix\":\"help\"}", &response); + std::string err = client.do_request("{\"prefix\":\"help\"}", &response); + if (!err.empty()) { + std::cerr << __func__ << " AdminSocketClient::do_request errored with: " + << err << std::endl; + return false; + } std::cout << response << '\n'; JSONParser parser; -- 2.47.3