Fix type assertion error after rebase

This commit is contained in:
Menghan Li 2016-07-08 10:35:38 -07:00
parent 562a45da66
commit ffdfb592e8
3 changed files with 5 additions and 5 deletions

View File

@ -155,7 +155,7 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
t, put, err = cc.getTransport(ctx, gopts)
if err != nil {
// TODO(zhaoq): Probably revisit the error handling.
if _, ok := err.(rpcError); ok {
if _, ok := err.(*rpcError); ok {
return err
}
if err == errConnClosing {

View File

@ -392,17 +392,17 @@ func toRPCErr(err error) error {
default:
switch err {
case context.DeadlineExceeded:
return rpcError{
return &rpcError{
code: codes.DeadlineExceeded,
desc: err.Error(),
}
case context.Canceled:
return rpcError{
return &rpcError{
code: codes.Canceled,
desc: err.Error(),
}
case ErrClientConnClosing:
return rpcError{
return &rpcError{
code: codes.FailedPrecondition,
desc: err.Error(),
}

View File

@ -149,7 +149,7 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
t, put, err = cc.getTransport(ctx, gopts)
if err != nil {
// TODO(zhaoq): Probably revisit the error handling.
if _, ok := err.(rpcError); ok {
if _, ok := err.(*rpcError); ok {
return nil, err
}
if err == errConnClosing {