log panics
This commit is contained in:
parent
4cb22b5969
commit
a7312f5c7e
@ -98,7 +98,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ch <- errors.InternalServerError("go.micro.client", "request error")
|
||||
ch <- errors.InternalServerError("go.micro.client", fmt.Sprintf("panic recovered: %v", r))
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -53,7 +53,8 @@ func (s *rpcServer) accept(sock transport.Socket) {
|
||||
sock.Close()
|
||||
|
||||
if r := recover(); r != nil {
|
||||
log.Log(r, string(debug.Stack()))
|
||||
log.Log("panic recovered: ", r)
|
||||
log.Log(string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -319,7 +319,7 @@ func (h *httpTransportListener) Accept(fn func(Socket)) error {
|
||||
// TODO: think of a better error response strategy
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Logf("http: recovered %v", r)
|
||||
log.Log("panic recovered: ", r)
|
||||
sock.Close()
|
||||
}
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user