mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
chore(err): Extract crossslot err and add test
This commit is contained in:
6
error.go
6
error.go
@ -22,6 +22,12 @@ var ErrPoolExhausted = pool.ErrPoolExhausted
|
||||
// ErrPoolTimeout timed out waiting to get a connection from the connection pool.
|
||||
var ErrPoolTimeout = pool.ErrPoolTimeout
|
||||
|
||||
// ErrCrossSlot is returned when keys are used in the same Redis command and
|
||||
// the keys are not in the same hash slot. This error is returned by Redis
|
||||
// Cluster and will be returned by the client when TxPipeline or TxPipelined
|
||||
// is used on a ClusterClient with keys in different slots.
|
||||
var ErrCrossSlot = proto.RedisError("CROSSSLOT Keys in request don't hash to the same slot")
|
||||
|
||||
// HasErrorPrefix checks if the err is a Redis error and the message contains a prefix.
|
||||
func HasErrorPrefix(err error, prefix string) bool {
|
||||
var rErr Error
|
||||
|
Reference in New Issue
Block a user