From 02481c4446f2bb8c9e59f6ba81fd37ab0b0c9b34 Mon Sep 17 00:00:00 2001 From: Asim Date: Thu, 30 Jun 2016 16:19:02 +0100 Subject: [PATCH] request panic catch all --- client/rpc_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/rpc_client.go b/client/rpc_client.go index 33503b34..d1cdd706 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -94,6 +94,12 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp ch := make(chan error, 1) go func() { + defer func() { + if r := recover(); r != nil { + ch <- errors.InternalServerError("go.micro.client", "request error") + } + }() + // send request if err := stream.Send(req.Request()); err != nil { ch <- err