IExceptionDetector.IsCancellation(Exception, CancellationToken) Method

Definition

Returns whether the provided exception represents a cancellation event for the current provider.

public bool IsCancellation (Exception exception, System.Threading.CancellationToken cancellationToken = default);
abstract member IsCancellation : Exception * System.Threading.CancellationToken -> bool
Public Function IsCancellation (exception As Exception, Optional cancellationToken As CancellationToken = Nothing) As Boolean

Parameters

exception
Exception

The exception to be checked for cancellation.

cancellationToken
CancellationToken

If exception is insufficient for identifying a cancellation, this is the cancellation token passed to the asynchronous operation; it can be checked instead as a fallback mechanism.

Returns

Applies to