diff options
Diffstat (limited to 'modules/rpc/jsonrpc.cpp')
-rw-r--r-- | modules/rpc/jsonrpc.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/rpc/jsonrpc.cpp b/modules/rpc/jsonrpc.cpp index 8c16f4cc8..cd24dc55c 100644 --- a/modules/rpc/jsonrpc.cpp +++ b/modules/rpc/jsonrpc.cpp @@ -122,13 +122,8 @@ public: return true; } - event->second->Run(this, client, request); - - if (request.GetError()) - { - SendError(reply, request.GetError()->first, request.GetError()->second, id); - return true; - } + if (!event->second->Run(this, client, request)) + return false; this->Reply(request); return true; @@ -136,6 +131,12 @@ public: void Reply(RPCRequest &request) override { + if (request.GetError()) + { + SendError(request.reply, request.GetError()->first, request.GetError()->second, request.id); + return; + } + // {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]} auto* doc = yyjson_mut_doc_new(nullptr); |