Skip to content

Commit

Permalink
Add req.Data to OnMessage panic error log
Browse files Browse the repository at this point in the history
  • Loading branch information
shenchao committed Apr 20, 2022
1 parent 2373592 commit 7500e28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions remoting/getty/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) {
if e := recover(); e != nil {
resp.Status = hessian.Response_SERVER_ERROR
if err, ok := e.(error); ok {
logger.Errorf("OnMessage panic: %+v", perrors.WithStack(err))
logger.Errorf("OnMessage panic: %+v, req: %#v", perrors.WithStack(err), req.Data)
resp.Error = perrors.WithStack(err)
} else if err, ok := e.(string); ok {
logger.Errorf("OnMessage panic: %+v", perrors.New(err))
logger.Errorf("OnMessage panic: %+v, req: %#v", perrors.New(err), req.Data)
resp.Error = perrors.New(err)
} else {
logger.Errorf("OnMessage panic: %+v, this is impossible.", e)
logger.Errorf("OnMessage panic: %+v, this is impossible. req: %#v", e, req.Data)
resp.Error = fmt.Errorf("OnMessage panic unknow exception. %+v", e)
}

Expand Down

0 comments on commit 7500e28

Please sign in to comment.