Skip to content

Commit

Permalink
Log context in case of websocket and socketio error
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehm committed Jun 10, 2019
1 parent 34e5599 commit c916d46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/socketio.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (s *SocketIoServer) onMessage(c *gosocketio.Channel, req map[string]json.Ra
s.metrics.SocketIORequests.With(common.Labels{"method": method, "status": "success"}).Inc()
return rv
}
glog.Error(c.Id(), " onMessage ", method, ": ", errors.ErrorStack(err))
glog.Error(c.Id(), " onMessage ", method, ": ", errors.ErrorStack(err), ", data ", string(params))
s.metrics.SocketIORequests.With(common.Labels{"method": method, "status": "failure"}).Inc()
e := resultError{}
e.Error.Message = err.Error()
Expand Down
2 changes: 1 addition & 1 deletion server/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func (s *WebsocketServer) onRequest(c *websocketChannel, req *websocketReq) {
glog.V(1).Info("Client ", c.id, " onRequest ", req.Method, " success")
s.metrics.WebsocketRequests.With(common.Labels{"method": req.Method, "status": "success"}).Inc()
} else {
glog.Error("Client ", c.id, " onMessage ", req.Method, ": ", errors.ErrorStack(err))
glog.Error("Client ", c.id, " onMessage ", req.Method, ": ", errors.ErrorStack(err), ", data ", string(req.Params))
s.metrics.WebsocketRequests.With(common.Labels{"method": req.Method, "status": "failure"}).Inc()
e := resultError{}
e.Error.Message = err.Error()
Expand Down

0 comments on commit c916d46

Please sign in to comment.