diff --git a/src/NATS.Client.Core/NatsConnection.cs b/src/NATS.Client.Core/NatsConnection.cs index 97b2674a9..fac33fc07 100644 --- a/src/NATS.Client.Core/NatsConnection.cs +++ b/src/NATS.Client.Core/NatsConnection.cs @@ -640,6 +640,10 @@ private async Task PublishEventsAsync() } } } + catch (OperationCanceledException) + { + // Ignore, we're disposing the connection + } catch (Exception ex) { _logger.LogError(NatsLogEvents.Connection, ex, "Error occured when publishing events");