Skip to content

Commit

Permalink
request panic catch all
Browse files Browse the repository at this point in the history
  • Loading branch information
Asim committed Jun 30, 2016
1 parent 7640a76 commit 02481c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 02481c4

Please sign in to comment.