Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'Redis' in error replies #206

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2999,7 +2999,7 @@ void aclCommand(client *c) {
} else if (server.acl_filename[0] == '\0' &&
(!strcasecmp(sub,"load") || !strcasecmp(sub,"save")))
{
addReplyError(c,"This Redis instance is not configured to use an ACL file. You may want to specify users via the ACL SETUSER command and then issue a CONFIG REWRITE (assuming you have a Redis configuration file set) in order to store users in the Redis configuration.");
addReplyError(c,"This instance is not configured to use an ACL file. You may want to specify users via the ACL SETUSER command and then issue a CONFIG REWRITE (assuming you have a configuration file set) in order to store users in the configuration.");
return;
} else if (!strcasecmp(sub,"load") && c->argc == 2) {
sds errors = ACLLoadFromFile(server.acl_filename);
Expand Down
6 changes: 3 additions & 3 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2339,8 +2339,8 @@ static int isValidActiveDefrag(int val, const char **err) {
#ifndef HAVE_DEFRAG
if (val) {
*err = "Active defragmentation cannot be enabled: it "
"requires a Redis server compiled with a modified Jemalloc "
"like the one shipped by default with the Redis source "
"requires a server compiled with a modified Jemalloc "
"like the one shipped by default with the source "
"distribution";
return 0;
}
Expand Down Expand Up @@ -2564,7 +2564,7 @@ static int updateMaxclients(const char **err) {
if (aeResizeSetSize(server.el,
server.maxclients + CONFIG_FDSET_INCR) == AE_ERR)
{
*err = "The event loop API used by Redis is not able to handle the specified number of clients";
*err = "The event loop API is not able to handle the specified number of clients";
return 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -3540,7 +3540,7 @@ void waitCommand(client *c) {
long long offset = c->woff;

if (server.masterhost) {
addReplyError(c,"WAIT cannot be used with replica instances. Please also note that since Redis 4.0 if a replica is configured to be writable (which is not the default) writes to replicas are just local and are not propagated.");
addReplyError(c,"WAIT cannot be used with replica instances. Please also note that if a replica is configured to be writable (which is not the default) writes to replicas are just local and are not propagated.");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ void scriptKill(client *c, int is_eval) {
static int scriptVerifyCommandArity(struct serverCommand *cmd, int argc, sds *err) {
if (!cmd || ((cmd->arity > 0 && cmd->arity != argc) || (argc < -cmd->arity))) {
if (cmd)
*err = sdsnew("Wrong number of args calling Redis command from script");
*err = sdsnew("Wrong number of args calling command from script");
else
*err = sdsnew("Unknown Redis command called from script");
*err = sdsnew("Unknown command called from script");
return C_ERR;
}
return C_OK;
Expand Down
6 changes: 3 additions & 3 deletions src/script_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ static robj **luaArgsToRedisArgv(lua_State *lua, int *argc, int *argv_len) {
/* Require at least one argument */
*argc = lua_gettop(lua);
if (*argc == 0) {
luaPushError(lua, "Please specify at least one argument for this redis lib call");
luaPushError(lua, "Please specify at least one argument for this call");
return NULL;
}

Expand Down Expand Up @@ -859,7 +859,7 @@ static robj **luaArgsToRedisArgv(lua_State *lua, int *argc, int *argv_len) {
* integers as well). */
if (j != *argc) {
freeLuaRedisArgv(lua_argv, j, lua_argv_size);
luaPushError(lua, "Lua redis lib command arguments must be strings or integers");
luaPushError(lua, "Command arguments must be strings or integers");
return NULL;
}

Expand Down Expand Up @@ -1146,7 +1146,7 @@ static int luaRedisAclCheckCmdPermissionsCommand(lua_State *lua) {
/* Find command */
struct serverCommand *cmd;
if ((cmd = lookupCommand(argv, argc)) == NULL) {
luaPushError(lua, "Invalid command passed to redis.acl_check_cmd()");
luaPushError(lua, "Invalid command passed to server.acl_check_cmd()");
raise_error = 1;
} else {
int keyidxptr;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/acl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ start_server {tags {"acl external:skip"}} {
test {ACL load non-existing configured ACL file} {
catch {r ACL load} err
set err
} {*Redis instance is not configured to use an ACL file*}
} {*instance is not configured to use an ACL file*}
zuiderkwast marked this conversation as resolved.
Show resolved Hide resolved

# If there is an AUTH failure the metric increases
test {ACL-Metrics user AUTH failure} {
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/scripting.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ start_server {tags {"scripting"}} {
run_script "redis.call('nosuchcommand')" 0
} e
set e
} {*Unknown Redis*}
} {*Unknown command*}

test {EVAL - redis.call variant raises a Lua error on Redis cmd error (1)} {
set e {}
Expand Down Expand Up @@ -896,8 +896,8 @@ start_server {tags {"scripting"}} {
} {ERR Number of keys can't be negative}

test {Scripts can handle commands with incorrect arity} {
assert_error "ERR Wrong number of args calling Redis command from script*" {run_script "redis.call('set','invalid')" 0}
assert_error "ERR Wrong number of args calling Redis command from script*" {run_script "redis.call('incr')" 0}
assert_error "ERR Wrong number of args calling command from script*" {run_script "redis.call('set','invalid')" 0}
assert_error "ERR Wrong number of args calling command from script*" {run_script "redis.call('incr')" 0}
}

test {Correct handling of reused argv (issue #1939)} {
Expand Down Expand Up @@ -1022,7 +1022,7 @@ start_server {tags {"scripting"}} {
} 0] {}

# Check error due to invalid command
assert_error {ERR *Invalid command passed to redis.acl_check_cmd()*} {run_script {
assert_error {ERR *Invalid command passed to server.acl_check_cmd()*} {run_script {
return redis.acl_check_cmd('invalid-cmd','arg')
} 0}
}
Expand Down Expand Up @@ -1542,7 +1542,7 @@ start_server {tags {"scripting needs:debug external:skip"}} {
r write $cmd
r flush
set ret [r read]
assert_match {*Unknown Redis command called from script*} $ret
assert_match {*Unknown command called from script*} $ret
# make sure the server is still ok
reconnect
assert_equal [r ping] {PONG}
Expand Down Expand Up @@ -2385,7 +2385,7 @@ start_server {tags {"scripting"}} {
}

test "LUA test pcall with non string/integer arg" {
assert_error "ERR Lua redis lib command arguments must be strings or integers*" {
assert_error "ERR Command arguments must be strings or integers*" {
r eval {
local x={}
return redis.call("ping", x)
Expand Down
Loading