Add method name to "Method not registered" error
authorYaroslav Brustinov <[email protected]>
Sun, 23 Oct 2016 05:56:10 +0000 (07:56 +0200)
committerYaroslav Brustinov <[email protected]>
Fri, 28 Oct 2016 12:38:33 +0000 (14:38 +0200)
Signed-off-by: Yaroslav Brustinov <[email protected]>
src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp

index 9d9de53..4fa2447 100644 (file)
@@ -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;
     }