diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-16 05:37:14 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-16 08:37:14 -0400 |
commit | 6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch) | |
tree | 3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/go-redis/redis/internal/error.go | |
parent | bf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff) | |
download | chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2 chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip |
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/go-redis/redis/internal/error.go')
-rw-r--r-- | vendor/github.com/go-redis/redis/internal/error.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/github.com/go-redis/redis/internal/error.go b/vendor/github.com/go-redis/redis/internal/error.go index 0898eeb62..7b419577e 100644 --- a/vendor/github.com/go-redis/redis/internal/error.go +++ b/vendor/github.com/go-redis/redis/internal/error.go @@ -4,13 +4,9 @@ import ( "io" "net" "strings" -) - -const Nil = RedisError("redis: nil") - -type RedisError string -func (e RedisError) Error() string { return string(e) } + "github.com/go-redis/redis/internal/proto" +) func IsRetryableError(err error, retryNetError bool) bool { if IsNetworkError(err) { @@ -30,7 +26,7 @@ func IsRetryableError(err error, retryNetError bool) bool { } func IsRedisError(err error) bool { - _, ok := err.(RedisError) + _, ok := err.(proto.RedisError) return ok } @@ -42,6 +38,10 @@ func IsNetworkError(err error) bool { return ok } +func IsReadOnlyError(err error) bool { + return strings.HasPrefix(err.Error(), "READONLY ") +} + func IsBadConn(err error, allowTimeout bool) bool { if err == nil { return false |