Index: grpc/prpc/client.go |
diff --git a/grpc/prpc/client.go b/grpc/prpc/client.go |
index ff6b68bbad95d5465b463491d7841d5c18779d5b..da61581ef6ed6be77fd0bbd76d07e51be1f5d58a 100644 |
--- a/grpc/prpc/client.go |
+++ b/grpc/prpc/client.go |
@@ -203,7 +203,8 @@ func (c *Client) CallRaw(ctx context.Context, serviceName, methodName string, in |
} |
if err != nil { |
// Treat all errors here as transient. |
- return errors.WrapTransient(fmt.Errorf("failed to send request: %s", err)) |
+ return errors.Annotate(err).Reason("failed to send request"). |
+ Tag(retry.Tag).Err() |
} |
if options.resHeaderMetadata != nil { |
@@ -266,7 +267,7 @@ func (c *Client) CallRaw(ctx context.Context, serviceName, methodName string, in |
// AppEngine), and should be automatically retried even if a gRPC code |
// header is not supplied. |
if res.StatusCode >= http.StatusInternalServerError { |
- err = errors.WrapTransient(err) |
+ err = retry.Tag.Apply(err) |
} |
return err |
} |
@@ -279,12 +280,7 @@ func (c *Client) CallRaw(ctx context.Context, serviceName, methodName string, in |
code := codes.Code(codeInt) |
if code != codes.OK { |
- desc := strings.TrimSuffix(buf.String(), "\n") |
- err := grpcutil.Errf(code, "%s", desc) |
- if grpcutil.IsTransientCode(code) { |
- err = errors.WrapTransient(err) |
- } |
- return err |
+ return grpcutil.Errf(code, "%s", strings.TrimSuffix(buf.String(), "\n")) |
} |
return nil |
}, |