MCPcopy
hub / github.com/grpc/grpc-go / errToPickResult

Function errToPickResult

balancer/rls/picker.go:169–180  ·  view source on GitHub ↗

errToPickResult is a helper function which converts the error value returned by Pick() to a string that represents the pick result.

(err error)

Source from the content-addressed store, hash-verified

167// errToPickResult is a helper function which converts the error value returned
168// by Pick() to a string that represents the pick result.
169func errToPickResult(err error) string {
170 if err == nil {
171 return "complete"
172 }
173 if errors.Is(err, balancer.ErrNoSubConnAvailable) {
174 return "queue"
175 }
176 if _, ok := status.FromError(err); ok {
177 return "drop"
178 }
179 return "fail"
180}
181
182// delegateToChildPoliciesLocked is a helper function which iterates through the
183// list of child policy wrappers in a cache entry and attempts to find a child

Calls 2

FromErrorFunction · 0.92
IsMethod · 0.80

Tested by 1