Skip to content

Commit

Permalink
return a custom error to fail fast
Browse files Browse the repository at this point in the history
  • Loading branch information
demmer committed May 21, 2024
1 parent 91cc200 commit f6818d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/vt/vtgateproxy/firstready_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ limitations under the License.
// https://github.com/grpc/grpc-go/blob/master/pickfirst.go

import (
"errors"
"sync"

"google.golang.org/grpc/balancer"
Expand Down Expand Up @@ -60,7 +61,7 @@ func (f *frPickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker {
log.V(100).Infof("first_ready: Build called with info: %v", info)

if len(info.ReadySCs) == 0 {
return base.NewErrPicker(balancer.ErrNoSubConnAvailable)
return base.NewErrPicker(errors.New("no available connections"))
}

f.mu.Lock()
Expand Down

0 comments on commit f6818d9

Please sign in to comment.