File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,24 @@ import (
6
6
"net"
7
7
"strings"
8
8
9
+ "github.com/go-redis/redis/v7/internal/pool"
9
10
"github.com/go-redis/redis/v7/internal/proto"
10
11
)
11
12
13
+ var ErrClosed = pool .ErrClosed
14
+
15
+ type Error interface {
16
+ error
17
+
18
+ // RedisError is a no-op function but
19
+ // serves to distinguish types that are Redis
20
+ // errors from ordinary errors: a type is a
21
+ // Redis error if it has a RedisError method.
22
+ RedisError ()
23
+ }
24
+
25
+ var _ Error = proto .RedisError ("" )
26
+
12
27
func isRetryableError (err error , retryTimeout bool ) bool {
13
28
switch err {
14
29
case nil , context .Canceled , context .DeadlineExceeded :
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ type RedisError string
24
24
25
25
func (e RedisError ) Error () string { return string (e ) }
26
26
27
+ func (RedisError ) RedisError () {}
28
+
27
29
//------------------------------------------------------------------------------
28
30
29
31
type MultiBulkParse func (* Reader , int64 ) (interface {}, error )
You can’t perform that action at this time.
0 commit comments