Skip to content

Commit

Permalink
Fix wrongly append the ERR prefix in no script error (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Mar 27, 2024
1 parent 3938a95 commit 6263122
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/storage/scripting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6263122

Please sign in to comment.