Skip to content

Commit

Permalink
client: don't allow io.EOF to be passed from balancer to user (#2604)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Jan 31, 2019
1 parent 25e74d3 commit 1925e24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion picker_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,16 @@ func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer.
continue
}
return nil, nil, status.Errorf(codes.Unavailable, "%v, latest connection error: %v", err, bp.connectionError())
case context.DeadlineExceeded:
return nil, nil, status.Error(codes.DeadlineExceeded, err.Error())
case context.Canceled:
return nil, nil, status.Error(codes.Canceled, err.Error())
default:
if _, ok := status.FromError(err); ok {
return nil, nil, err
}
// err is some other error.
return nil, nil, toRPCErr(err)
return nil, nil, status.Error(codes.Unknown, err.Error())
}
}

Expand Down

0 comments on commit 1925e24

Please sign in to comment.