log socket disconnected error.

This commit is contained in:
Miroslav Šedivý 2020-10-28 22:09:02 +01:00
parent 1ce6dad973
commit 91fed3c480

View File

@ -228,7 +228,9 @@ func (ws *WebSocketHandler) handle(connection *websocket.Conn, id string) {
defer func() { defer func() {
ticker.Stop() ticker.Stop()
ws.logger.Debug().Str("address", connection.RemoteAddr().String()).Msg("handle socket ending") ws.logger.Debug().Str("address", connection.RemoteAddr().String()).Msg("handle socket ending")
ws.handler.Disconnected(id) if err := ws.handler.Disconnected(id); err != nil {
ws.logger.Warn().Err(err).Msg("socket disconnected with error")
}
}() }()
for { for {