mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
request panic catch all
This commit is contained in:
parent
7640a76d88
commit
02481c4446
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user