[#358] pool: Make ErrPoolClientUnhealthy unexported

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-11-08 14:53:57 +03:00 committed by Alex Vanin
parent 5f9d846fb4
commit e35f0df1ca

View file

@ -95,8 +95,8 @@ type clientStatus interface {
methodsStatus() []statusSnapshot
}
// ErrPoolClientUnhealthy is an error to indicate that client in pool is unhealthy.
var ErrPoolClientUnhealthy = errors.New("pool client unhealthy")
// errPoolClientUnhealthy is an error to indicate that client in pool is unhealthy.
var errPoolClientUnhealthy = errors.New("pool client unhealthy")
// clientStatusMonitor count error rate and other statistics for connection.
type clientStatusMonitor struct {
@ -302,7 +302,7 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change
var wasHealthy bool
if _, err := c.endpointInfo(ctx, prmEndpointInfo{}); err == nil {
return true, false
} else if !errors.Is(err, ErrPoolClientUnhealthy) {
} else if !errors.Is(err, errPoolClientUnhealthy) {
wasHealthy = true
}
@ -342,7 +342,7 @@ func (c *clientWrapper) getClient() (*sdkClient.Client, error) {
if c.isHealthy() {
return c.client, nil
}
return nil, ErrPoolClientUnhealthy
return nil, errPoolClientUnhealthy
}
// balanceGet invokes sdkClient.BalanceGet parse response status to error and return result as is.