File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 3030 ErrNoRwInstance = errors .New ("can't find rw instance in pool" )
3131 ErrNoRoInstance = errors .New ("can't find ro instance in pool" )
3232 ErrNoHealthyInstance = errors .New ("can't find healthy instance in pool" )
33+ ErrExists = errors .New ("endpoint exists" )
3334 ErrClosed = errors .New ("pool is closed" )
3435)
3536
@@ -233,7 +234,7 @@ func (pool *ConnectionPool) Add(addr string) error {
233234 }
234235 if _ , ok := pool .addrs [addr ]; ok {
235236 pool .addrsMutex .Unlock ()
236- return errors . New ( "endpoint exist" )
237+ return ErrExists
237238 }
238239 pool .addrs [addr ] = e
239240 pool .addrsMutex .Unlock ()
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ func TestAdd_exist(t *testing.T) {
282282 defer connPool .Close ()
283283
284284 err = connPool .Add (servers [0 ])
285- require .ErrorContains (t , err , "endpoint exist" )
285+ require .Equal (t , connection_pool . ErrExists , err )
286286
287287 args := test_helpers.CheckStatusesArgs {
288288 ConnPool : connPool ,
You can’t perform that action at this time.
0 commit comments