Differentiate SCRIPT KILL error replies.

When calling SCRIPT KILL currently you can get two errors:

* No script in timeout (busy) state.
* The script already performed a write.

It is useful to be able to distinguish the two errors, but right now both
start with "ERR" prefix, so string matching (that is fragile) must be used.

This commit introduces two different prefixes.

-NOTBUSY and -UNKILLABLE respectively to reply with an error when no
script is busy at the moment, and when the script already executed a
write operation and can not be killed.
This commit is contained in:
antirez
2012-10-22 10:28:54 +02:00
parent a1b1c1ea3a
commit acfe3675e3
2 changed files with 3 additions and 3 deletions

View File

@ -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
}