diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-10-23 07:56:10 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-10-28 14:38:33 +0200 |
commit | 7f69fa8d0ef16124b266cd5a474942f432140d11 (patch) | |
tree | b4a7e6312d97b1aec7069131a6b13ac325ca8389 | |
parent | 2dab6b6d09f9f1474d2ade6b465ebfa5ce3b3f5e (diff) |
Add method name to "Method not registered" error
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rw-r--r-- | src/rpc-server/trex_rpc_jsonrpc_v2_parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |