From ac333d9d47f98dfd5050005d5396378d012c655d Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 16 Mar 2020 13:33:38 +0300 Subject: [PATCH] client/grpc: unwrap error after call (#1352) Signed-off-by: Vasiliy Tolstov --- client/grpc/grpc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index df1de990..1f92b7c4 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -445,10 +445,6 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface // call backoff first. Someone may want an initial start delay t, err := callOpts.Backoff(ctx, req, i) if err != nil { - if verr, ok := err.(*errors.Error); ok { - return verr - } - return errors.InternalServerError("go.micro.client", err.Error()) } @@ -469,6 +465,10 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface // make the call err = gcall(ctx, node, req, rsp, callOpts) + if verr, ok := err.(*errors.Error); ok { + return verr + } + g.opts.Selector.Mark(service, node, err) return err }