From: Yaroslav Brustinov Date: Sun, 23 Oct 2016 05:56:10 +0000 (+0200) Subject: Add method name to "Method not registered" error X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=7f69fa8d0ef16124b266cd5a474942f432140d11;p=trex.git Add method name to "Method not registered" error Signed-off-by: Yaroslav Brustinov --- diff --git a/src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp b/src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp index 9d9de53a..4fa2447d 100644 --- a/src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp +++ b/src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp @@ -192,7 +192,9 @@ void TrexJsonRpcV2Parser::parse_single_request(Json::Value &request, /* lookup the method in the DB */ TrexRpcCommand * rpc_cmd = TrexRpcCommandsTable::get_instance().lookup(method_name); if (!rpc_cmd) { - commands.push_back(new JsonRpcError(msg_id, JSONRPC_V2_ERR_METHOD_NOT_FOUND, "Method not registered")); + std::stringstream err; + err << "Method " << method_name << " not registered"; + commands.push_back(new JsonRpcError(msg_id, JSONRPC_V2_ERR_METHOD_NOT_FOUND, err.str())); return; }