This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 62631223 Fix wrongly append the ERR prefix in no script error (#2201)
62631223 is described below

commit 62631223abc0fc4a462380bdb38172129dc6180b
Author: Lloyd Zhou <[email protected]>
AuthorDate: Wed Mar 27 09:53:23 2024 +0800

    Fix wrongly append the ERR prefix in no script error (#2201)
---
 src/storage/scripting.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/storage/scripting.cc b/src/storage/scripting.cc
index 65d8179d..a16205a4 100644
--- a/src/storage/scripting.cc
+++ b/src/storage/scripting.cc
@@ -30,6 +30,7 @@
 #include <string>
 
 #include "commands/commander.h"
+#include "commands/error_constants.h"
 #include "db_util.h"
 #include "fmt/format.h"
 #include "lua.h"
@@ -610,7 +611,8 @@ Status EvalGenericCommand(redis::Connection *conn, const 
std::string &body_or_sh
       auto s = srv->ScriptGet(funcname + 2, &body);
       if (!s.IsOK()) {
         lua_pop(lua, 1); /* remove the error handler from the stack. */
-        return {Status::NotOK, "NOSCRIPT No matching script. Please use EVAL"};
+        *output = redis::Error(redis::errNoMatchingScript);
+        return Status::OK();
       }
     } else {
       body = body_or_sha;

Reply via email to