summaryrefslogtreecommitdiff
path: root/src/scripting.c
diff options
context:
space:
mode:
authorMadelyn Olson <matolson@amazon.com>2019-10-30 00:11:17 -0700
committerMadelyn Olson <matolson@amazon.com>2019-12-16 23:34:37 -0800
commit576a08908b0fcf85a01803507238c4cc14bd85d1 (patch)
treee2642852135bf6305c17bc3e45a5aaf32e8e456d /src/scripting.c
parent44aa22c63553d6be2879c51161feb50c1b31eab8 (diff)
downloadredis-576a08908b0fcf85a01803507238c4cc14bd85d1.tar.gz
Split error message so dependandent callers give a useful result
Diffstat (limited to 'src/scripting.c')
-rw-r--r--src/scripting.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scripting.c b/src/scripting.c
index c627207d5..96eb9681d 100644
--- a/src/scripting.c
+++ b/src/scripting.c
@@ -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");