mirror of
https://github.com/redis/go-redis.git
synced 2025-07-03 02:42:25 +03:00
Export pool errors for public consumption (#3380)
This commit is contained in:
7
error.go
7
error.go
@ -15,6 +15,13 @@ import (
|
|||||||
// ErrClosed performs any operation on the closed client will return this error.
|
// ErrClosed performs any operation on the closed client will return this error.
|
||||||
var ErrClosed = pool.ErrClosed
|
var ErrClosed = pool.ErrClosed
|
||||||
|
|
||||||
|
// ErrPoolExhausted is returned from a pool connection method
|
||||||
|
// when the maximum number of database connections in the pool has been reached.
|
||||||
|
var ErrPoolExhausted = pool.ErrPoolExhausted
|
||||||
|
|
||||||
|
// ErrPoolTimeout timed out waiting to get a connection from the connection pool.
|
||||||
|
var ErrPoolTimeout = pool.ErrPoolTimeout
|
||||||
|
|
||||||
// HasErrorPrefix checks if the err is a Redis error and the message contains a prefix.
|
// HasErrorPrefix checks if the err is a Redis error and the message contains a prefix.
|
||||||
func HasErrorPrefix(err error, prefix string) bool {
|
func HasErrorPrefix(err error, prefix string) bool {
|
||||||
var rErr Error
|
var rErr Error
|
||||||
|
@ -11,8 +11,6 @@ import (
|
|||||||
"github.com/redis/go-redis/v9/internal/pool"
|
"github.com/redis/go-redis/v9/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrPoolTimeout = pool.ErrPoolTimeout
|
|
||||||
|
|
||||||
func (c *baseClient) Pool() pool.Pooler {
|
func (c *baseClient) Pool() pool.Pooler {
|
||||||
return c.connPool
|
return c.connPool
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user