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 30
30
ErrNoRwInstance = errors .New ("can't find rw instance in pool" )
31
31
ErrNoRoInstance = errors .New ("can't find ro instance in pool" )
32
32
ErrNoHealthyInstance = errors .New ("can't find healthy instance in pool" )
33
+ ErrExists = errors .New ("endpoint exists" )
33
34
ErrClosed = errors .New ("pool is closed" )
34
35
)
35
36
@@ -233,7 +234,7 @@ func (pool *ConnectionPool) Add(addr string) error {
233
234
}
234
235
if _ , ok := pool .addrs [addr ]; ok {
235
236
pool .addrsMutex .Unlock ()
236
- return errors . New ( "endpoint exist" )
237
+ return ErrExists
237
238
}
238
239
pool .addrs [addr ] = e
239
240
pool .addrsMutex .Unlock ()
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ func TestAdd_exist(t *testing.T) {
282
282
defer connPool .Close ()
283
283
284
284
err = connPool .Add (servers [0 ])
285
- require .ErrorContains (t , err , "endpoint exist" )
285
+ require .Equal (t , connection_pool . ErrExists , err )
286
286
287
287
args := test_helpers.CheckStatusesArgs {
288
288
ConnPool : connPool ,
You can’t perform that action at this time.
0 commit comments