Source File
error.go
Belonging Package
github.com/go-redis/redis/v8
RedisError()
}
var _ Error = proto.RedisError("")
func ( error, bool) bool {
switch {
case io.EOF, io.ErrUnexpectedEOF:
return true
case nil, context.Canceled, context.DeadlineExceeded:
return false
}
if , := .(timeoutError); {
if .Timeout() {
return
}
return true
}
:= .Error()
if == "ERR max number of clients reached" {
return true
}
if strings.HasPrefix(, "LOADING ") {
return true
}
if strings.HasPrefix(, "READONLY ") {
return true
}
if strings.HasPrefix(, "CLUSTERDOWN ") {
return true
}
return false
}
func ( error) bool {
, := .(proto.RedisError)
return
}
func ( error, bool) bool {
if == nil {
return false
}
return isReadOnlyError()
}
if {
if , := .(net.Error); && .Timeout() {
return !.Temporary()
}
}
return true
}
func ( error) ( bool, bool, string) {
if !isRedisError() {
return
}
:= .Error()
switch {
case strings.HasPrefix(, "MOVED "):
= true
case strings.HasPrefix(, "ASK "):
= true
default:
return
}
:= strings.LastIndex(, " ")
if == -1 {
return false, false, ""
}
= [+1:]
return
}
func ( error) bool {
return strings.HasPrefix(.Error(), "LOADING ")
}
func ( error) bool {
return strings.HasPrefix(.Error(), "READONLY ")
}
type timeoutError interface {
Timeout() bool
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |