Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async Task ListenAsync(CancellationToken cancellationToken)

_ = OnBrowserConnected(webSocketContext.WebSocket, webSocketContext.SecWebSocketProtocols.FirstOrDefault());
}
catch (Exception e)
catch (Exception e) when (e is not (OperationCanceledException or ObjectDisposedException))
{
Logger.LogError("Accepting web socket exception: {Message}", e.Message);

Expand All @@ -70,13 +70,13 @@ async Task ListenAsync(CancellationToken cancellationToken)
}
}
}
catch (OperationCanceledException)
catch (Exception e) when (e is OperationCanceledException or ObjectDisposedException)
{
// nop
// expected during shutdown
}
catch (Exception e)
{
Logger.LogError("HttpListener exception: {Message}", e.Message);
Logger.LogError("Unexpected HttpListener exception: {Message}", e.Message);
}
}
}
Expand Down