From 1becd3ab5581cd4505dcbedf3bc95bd367a09ba9 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Wed, 19 Oct 2022 18:57:03 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20throw=20an=20RPC=20Error=20when?= =?UTF-8?q?=20no=20`params`=20key=20is=20specified?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/net/rpc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/net/rpc.rs b/src/net/rpc.rs index 195009e1..effad59e 100644 --- a/src/net/rpc.rs +++ b/src/net/rpc.rs @@ -16,6 +16,7 @@ use std::collections::BTreeMap; use std::sync::Arc; use surrealdb::channel; use surrealdb::channel::Sender; +use surrealdb::sql::Array; use surrealdb::sql::Object; use surrealdb::sql::Strand; use surrealdb::sql::Value; @@ -145,7 +146,7 @@ impl Rpc { // Fetch the 'params' argument let params = match req.pick(&*PARAMS) { Value::Array(v) => v, - _ => return Response::failure(id, Failure::INVALID_REQUEST).send(chn).await, + _ => Array::new(), }; // Match the method to a function let res = match &method[..] {