Skip to content

Commit

Permalink
Merge pull request #135 from hmathieu31/bug/fix-unhandled-websocket-c…
Browse files Browse the repository at this point in the history
…onnection-terminaison

fix: fix exception logging loop when websocket connection is killed
  • Loading branch information
angelobreuer authored Jan 13, 2024
2 parents 1b4b6e4 + f6e044b commit f963aa8
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 f963aa8

Please sign in to comment.