diff --git a/internal/webrtc/peer.go b/internal/webrtc/peer.go index 3f030826..c7dd5fde 100644 --- a/internal/webrtc/peer.go +++ b/internal/webrtc/peer.go @@ -74,11 +74,8 @@ func (peer *WebRTCPeerCtx) Destroy() { // TODO: Send webrtc disconnect event via websocket. - if err := peer.connection.Close(); err != nil { - peer.logger.Warn().Err(err).Msg("peer connection destroyed with an error") - } else { - peer.logger.Info().Msg("peer connection destroyed") - } + err := peer.connection.Close() + peer.logger.Err(err).Msg("peer connection destroyed") peer.connection = nil } diff --git a/internal/websocket/peer.go b/internal/websocket/peer.go index a449a601..266c974a 100644 --- a/internal/websocket/peer.go +++ b/internal/websocket/peer.go @@ -80,11 +80,8 @@ func (peer *WebSocketPeerCtx) Destroy(reason string) { Message: reason, }) - if err := peer.connection.Close(); err != nil { - peer.logger.Warn().Err(err).Msg("peer connection destroyed with an error") - } else { - peer.logger.Info().Msg("peer connection destroyed") - } + err := peer.connection.Close() + peer.logger.Err(err).Msg("peer connection destroyed") peer.connection = nil }