Skip to content

Commit

Permalink
fix: fix exception logging loop when websocket connection is killed
Browse files Browse the repository at this point in the history
  • Loading branch information
hmathieu31 committed Jan 13, 2024
1 parent 1b4b6e4 commit f6e044b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Lavalink4NET/LavalinkNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ private async ValueTask ReceiveInternalAsync(ILavalinkSocket socket, Cancellatio
.ReceiveAsync(cancellationToken)
.ConfigureAwait(false);
}
catch (WebSocketException exception) when (exception.WebSocketErrorCode is WebSocketError.ConnectionClosedPrematurely)
{
_logger.ExceptionOccurredDuringCommunication(Label, exception);
break;
}
catch (Exception exception)
{
_logger.ExceptionOccurredDuringCommunication(Label, exception);
Expand Down

0 comments on commit f6e044b

Please sign in to comment.