From e5869b280055614b7e4f73beba5f6e135aaae48c Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Mon, 27 May 2019 11:55:03 +0200 Subject: [PATCH] Amended some error codes --- src/rpc/websocket_api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/websocket_api.cpp b/src/rpc/websocket_api.cpp index f69dca6..0798f8f 100644 --- a/src/rpc/websocket_api.cpp +++ b/src/rpc/websocket_api.cpp @@ -144,7 +144,7 @@ response websocket_api_connection::on_message( const std::string& message ) return response( variant(), { -32600, "Invalid id" }, "2.0" ); if( var_obj.contains( "method" ) && ( !var_obj["method"].is_string() || var_obj["method"].get_string() == "" ) ) - return response( variant(), { -32602, "Missing or invalid method" }, "2.0" ); + return response( variant(), { -32600, "Missing or invalid method" }, "2.0" ); if( var_obj.contains( "jsonrpc" ) && ( !var_obj["jsonrpc"].is_string() || var_obj["jsonrpc"] != "2.0" ) ) return response( variant(), { -32600, "Unsupported JSON-RPC version" }, "2.0" ); @@ -152,7 +152,7 @@ response websocket_api_connection::on_message( const std::string& message ) if( var_obj.contains( "method" ) ) { if( var_obj.contains( "params" ) && var_obj["params"].is_object() ) - return response( variant(), { -32600, "Named parameters not supported" }, "2.0" ); + return response( variant(), { -32602, "Named parameters not supported" }, "2.0" ); if( var_obj.contains( "params" ) && !var_obj["params"].is_array() ) return response( variant(), { -32600, "Invalid parameters" }, "2.0" ); @@ -170,7 +170,7 @@ response websocket_api_connection::on_message( const std::string& message ) return response(); } - return response( variant(), { -32602, "Missing method or result or error" }, "2.0" ); + return response( variant(), { -32600, "Missing method or result or error" }, "2.0" ); } void websocket_api_connection::on_response( const variant& var )