Split error message so dependandent callers give a useful result

This commit is contained in:
Madelyn Olson
2019-10-30 00:11:17 -07:00
parent 44aa22c635
commit 576a08908b
4 changed files with 27 additions and 12 deletions

View File

@ -686,11 +686,15 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
if (getNodeByQuery(c,c->cmd,c->argv,c->argc,NULL,&error_code) !=
server.cluster->myself)
{
if (error_code == CLUSTER_REDIR_DOWN_STATE) {
if (error_code == CLUSTER_REDIR_DOWN_RO_STATE) {
luaPushError(lua,
"Lua script attempted execute a write command while "
"Lua script attempted to execute a write command while the"
"cluster is down and readonly");
} else if (error_code == CLUSTER_REDIR_DOWN_STATE) {
luaPushError(lua,
"Lua script attempted to execute a command while the"
"cluster is down");
} else {
} else {}
luaPushError(lua,
"Lua script attempted to access a non local key in a "
"cluster node");