diff --git a/src/scripting.c b/src/scripting.c index 13f608e67..6f9ec2e89 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -977,9 +977,9 @@ void scriptCommand(redisClient *c) { sdsfree(sha); } else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"kill")) { if (server.lua_caller == NULL) { - addReplyError(c,"No scripts in execution right now."); + addReplySds(c,sdsnew("-NOTBUSY No scripts in execution right now.\r\n")); } else if (server.lua_write_dirty) { - addReplyError(c, "Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in an hard way using the SHUTDOWN NOSAVE command."); + addReplySds(c,sdsnew("-UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in an hard way using the SHUTDOWN NOSAVE command.\r\n")); } else { server.lua_kill = 1; addReply(c,shared.ok); diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 6dbdb6b63..f96d0fc64 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -301,7 +301,7 @@ start_server {tags {"scripting"}} { catch {r ping} e assert_match {BUSY*} $e catch {r script kill} e - assert_match {ERR*} $e + assert_match {UNKILLABLE*} $e catch {r ping} e assert_match {BUSY*} $e }