aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/call.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/grpc/call.go')
-rw-r--r--vendor/google.golang.org/grpc/call.go18
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)