mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
websocket: fix unwrap err.
This commit is contained in:
@@ -276,7 +276,9 @@ func (manager *WebSocketManagerCtx) connect(connection *websocket.Conn, r *http.
|
||||
|
||||
e, ok := err.(*websocket.CloseError)
|
||||
if !ok {
|
||||
err = errors.Unwrap(err) // unwrap if possible
|
||||
if e := errors.Unwrap(err); e != nil {
|
||||
err = e // unwrap if possible
|
||||
}
|
||||
logger.Warn().Err(err).Msg("read message error")
|
||||
// client is expected to reconnect soon
|
||||
delayedDisconnect = true
|
||||
|
||||
@@ -43,7 +43,9 @@ func (peer *WebSocketPeerCtx) Send(event string, payload any) {
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
err = errors.Unwrap(err) // unwrap if possible
|
||||
if e := errors.Unwrap(err); e != nil {
|
||||
err = e // unwrap if possible
|
||||
}
|
||||
peer.logger.Warn().Err(err).Str("event", event).Msg("send message error")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user