Skip to content

Commit

Permalink
Ignoring OperationCanceledException when pump is stopping.
Browse files Browse the repository at this point in the history
  • Loading branch information
makam committed Oct 25, 2019
1 parent 00b1bc6 commit 008bb2b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,18 @@ async Task MessagePumpTaskAsync()
}
});
}
catch (OperationCanceledException) when (pumpCancellationToken.IsCancellationRequested)
{
// Ignore as we are stopping the pump
}
catch (ObjectDisposedException) when (pumpCancellationToken.IsCancellationRequested)
{
// Ignore as we are stopping the pump
}
catch (Exception exception)
{
// Not reporting an ObjectDisposedException as we're stopping the pump
if (!(exception is ObjectDisposedException && this.pumpCancellationToken.IsCancellationRequested))
{
MessagingEventSource.Log.MessageReceivePumpTaskException(this.messageReceiver.ClientId, string.Empty, exception);
await this.RaiseExceptionReceived(exception, ExceptionReceivedEventArgsAction.Receive).ConfigureAwait(false);
}
MessagingEventSource.Log.MessageReceivePumpTaskException(this.messageReceiver.ClientId, string.Empty, exception);
await this.RaiseExceptionReceived(exception, ExceptionReceivedEventArgsAction.Receive).ConfigureAwait(false);
}
}
}
Expand Down

0 comments on commit 008bb2b

Please sign in to comment.