Type mismatch errors are now prefixed with WRONGTYPE.

So instead to reply with a generic error like:

-ERR ... wrong kind of value ...

now it replies with:

-WRONGTYPE ... wrong kind of value ...

This makes this particular error easy to check without resorting to
(fragile) pattern matching of the error string (however the error string
used to be consistent already).

Client libraries should return a specific exeption type for this error.

Most of the commit is about fixing unit tests.
This commit is contained in:
antirez
2012-11-06 20:25:34 +01:00
parent 06851a93de
commit c4b0b6854e
5 changed files with 26 additions and 26 deletions

View File

@ -170,7 +170,7 @@ start_server {tags {"bitops"}} {
r lpush c foo
catch {r bitop xor dest a b c d} e
set e
} {*ERR*}
} {WRONGTYPE*}
test {BITOP with empty string after non empty string (issue #529)} {
r flushdb