From 2ec9f6939b42b869edac12af5967cae953faab1a Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Tue, 26 Mar 2024 21:56:48 +0800 Subject: [PATCH] Fix wrongly append the ERR prefix in no script error --- 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 65d8179d500..a16205a45e0 100644 --- a/src/storage/scripting.cc +++ b/src/storage/scripting.cc @@ -30,6 +30,7 @@ #include #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;