]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/admin_socket_output: better error reporting 20409/head
authorBrad Hubbard <bhubbard@redhat.com>
Tue, 13 Feb 2018 00:22:53 +0000 (10:22 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Tue, 13 Feb 2018 00:22:53 +0000 (10:22 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/test/admin_socket_output.cc

index 89db393f65d4178b787c2a58a0767ca9d62cddf9..37bd732a5057ceaa8623bd6ba1df8179b0f6e870 100644 (file)
@@ -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;