From c1ff3ceee423bc7a747e20bccf8271108aea45e8 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 9 Aug 2019 12:31:29 +0100 Subject: [PATCH] Add more verbose not found error --- client/grpc/grpc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/grpc/grpc.go b/client/grpc/grpc.go index c6a3f5dd..7ae85347 100644 --- a/client/grpc/grpc.go +++ b/client/grpc/grpc.go @@ -74,7 +74,7 @@ func (g *grpcClient) next(request client.Request, opts client.CallOptions) (sele // get next nodes from the selector next, err := g.opts.Selector.Select(service, opts.SelectOptions...) if err != nil && err == selector.ErrNotFound { - return nil, errors.NotFound("go.micro.client", err.Error()) + return nil, errors.NotFound("go.micro.client", "service %s not found: %v", service, err.Error()) } else if err != nil { return nil, errors.InternalServerError("go.micro.client", err.Error()) } @@ -351,7 +351,7 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface // select next node node, err := next() if err != nil && err == selector.ErrNotFound { - return errors.NotFound("go.micro.client", err.Error()) + return errors.NotFound("go.micro.client", "service %s not found: %v", req.Service(), err.Error()) } else if err != nil { return errors.InternalServerError("go.micro.client", err.Error()) } @@ -430,7 +430,7 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli node, err := next() if err != nil && err == selector.ErrNotFound { - return nil, errors.NotFound("go.micro.client", err.Error()) + return nil, errors.NotFound("go.micro.client", "service %s not found: %v", req.Service(), err.Error()) } else if err != nil { return nil, errors.InternalServerError("go.micro.client", err.Error()) }