diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 17:16:14 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-07-17 18:24:20 +0100 |
commit | c9849d667ab55c23d343332a11afb3eb8ede3f2d (patch) | |
tree | 86684d5481d8b12be84ea1a3a8f32afaac007efa /vendor/google.golang.org/grpc/call.go | |
parent | 49f40a952943f26494d6407dc608b50b2ec0df7f (diff) |
Update vendor libs
Diffstat (limited to 'vendor/google.golang.org/grpc/call.go')
-rw-r--r-- | vendor/google.golang.org/grpc/call.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index d6d993b..84ac178 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -101,7 +101,7 @@ func sendRequest(ctx context.Context, codec Codec, compressor Compressor, callHd // Invoke is called by generated code. Also users can call Invoke directly when it // is really needed in their use cases. func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) (err error) { - var c callInfo + c := defaultCallInfo for _, o := range opts { if err := o.before(&c); err != nil { return toRPCErr(err) @@ -155,19 +155,17 @@ 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 err == ErrClientConnClosing { - return Errorf(codes.FailedPrecondition, "%v", err) + if _, ok := err.(*rpcError); ok { + return err } - if _, ok := err.(transport.StreamError); ok { - return toRPCErr(err) - } - if _, ok := err.(transport.ConnectionError); ok { + if err == errConnClosing { if c.failFast { - return toRPCErr(err) + return Errorf(codes.Unavailable, "%v", errConnClosing) } + continue } - // All the remaining cases are treated as retryable. - continue + // All the other errors are treated as Internal errors. + return Errorf(codes.Internal, "%v", err) } if c.traceInfo.tr != nil { c.traceInfo.tr.LazyLog(&payload{sent: true, msg: args}, true) |