clientv3: convert errors to rpctypes on returning

For https://github.com/coreos/etcd/issues/5211.
This commit is contained in:
Gyu-Ho Lee
2016-04-28 12:17:41 -07:00
parent f613052435
commit 2e3d79a7bf
8 changed files with 64 additions and 59 deletions

View File

@ -235,9 +235,9 @@ func dialEndpointList(c *Client) (*grpc.ClientConn, error) {
return nil, err
}
// isHalted returns true if the given error and context indicate no forward
// isHaltErr returns true if the given error and context indicate no forward
// progress can be made, even after reconnecting.
func isHalted(ctx context.Context, err error) bool {
func isHaltErr(ctx context.Context, err error) bool {
isRPCError := strings.HasPrefix(grpc.ErrorDesc(err), "etcdserver: ")
return isRPCError || ctx.Err() != nil
}