fix lua scripts error messages

fix lua scripts error messages by adding a full stop between the error message and the script info
This commit is contained in:
vitosotdihaet 2025-05-17 19:14:50 +03:00
parent 090f6252c4
commit 1030ca5e6b
3 changed files with 3 additions and 3 deletions

View File

@ -400,7 +400,7 @@ static int scriptVerifyWriteCommandAllow(scriptRunCtx *run_ctx, char **err) {
if (run_ctx->flags & SCRIPT_READ_ONLY &&
(run_ctx->c->cmd->flags & (CMD_WRITE|CMD_MAY_REPLICATE)))
{
*err = sdsnew("Write commands are not allowed from read-only scripts.");
*err = sdsnew("Write commands are not allowed from read-only scripts");
return C_ERR;
}

View File

@ -1668,7 +1668,7 @@ void luaCallFunction(scriptRunCtx* run_ctx, lua_State *lua, robj** keys, size_t
final_msg = sdscatfmt(final_msg, "-%s",
err_info.msg);
if (err_info.line && err_info.source) {
final_msg = sdscatfmt(final_msg, " script: %s, on %s:%s.",
final_msg = sdscatfmt(final_msg, ". script: %s, on %s:%s.",
run_ctx->funcname,
err_info.source,
err_info.line);

View File

@ -2345,7 +2345,7 @@ start_server {tags {"scripting"}} {
assert_equal [
r eval_ro {
local t = redis.pcall('set','x','y')
if t['err'] == "ERR Write commands are not allowed from read-only scripts." then
if t['err'] == "ERR Write commands are not allowed from read-only scripts" then
return 1
else
return 0