Skip to content

Commit 260a56c

Browse files
committed
fix error message generation
1 parent 19c65d0 commit 260a56c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentinel.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,11 +605,11 @@ func (c *sentinelFailover) MasterAddr(ctx context.Context) (string, error) {
605605
if masterAddr != "" {
606606
return masterAddr, nil
607607
}
608-
errs := make([]error, len(c.sentinelAddrs))
608+
errs := make([]error, 0, len(c.sentinelAddrs))
609609
for err := range errCh {
610610
errs = append(errs, err)
611611
}
612-
return "", fmt.Errorf("redis: all sentinels specified in configuration are unreachable: %w", errs)
612+
return "", fmt.Errorf("redis: all sentinels specified in configuration are unreachable: %w", errors.Join(errs...))
613613
}
614614

615615
func (c *sentinelFailover) replicaAddrs(ctx context.Context, useDisconnected bool) ([]string, error) {

0 commit comments

Comments
 (0)