From: Brad Hubbard Date: Tue, 13 Feb 2018 00:22:53 +0000 (+1000) Subject: test/admin_socket_output: better error reporting X-Git-Tag: v13.0.2~252^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20409%2Fhead;p=ceph.git test/admin_socket_output: better error reporting Signed-off-by: Brad Hubbard --- 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;