File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "github.com/redis/go-redis/v9/internal"
1717 "github.com/redis/go-redis/v9/internal/pool"
1818 "github.com/redis/go-redis/v9/internal/rand"
19+ "github.com/redis/go-redis/v9/internal/util"
1920)
2021
2122//------------------------------------------------------------------------------
@@ -782,7 +783,20 @@ func (c *sentinelFailover) MasterAddr(ctx context.Context) (string, error) {
782783 for err := range errCh {
783784 errs = append (errs , err )
784785 }
785- return "" , fmt .Errorf ("redis: all sentinels specified in configuration are unreachable: %w" , errors .Join (errs ... ))
786+ return "" , fmt .Errorf ("redis: all sentinels specified in configuration are unreachable: %s" , joinErrors (errs ))
787+ }
788+
789+ func joinErrors (errs []error ) string {
790+ if len (errs ) == 1 {
791+ return errs [0 ].Error ()
792+ }
793+
794+ b := []byte (errs [0 ].Error ())
795+ for _ , err := range errs [1 :] {
796+ b = append (b , '\n' )
797+ b = append (b , err .Error ()... )
798+ }
799+ return util .BytesToString (b )
786800}
787801
788802func (c * sentinelFailover ) replicaAddrs (ctx context.Context , useDisconnected bool ) ([]string , error ) {
You can’t perform that action at this time.
0 commit comments