ThrowHelper.ThrowOperationCanceledException Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ThrowOperationCanceledException(String, Exception, CancellationToken)
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException (string? message, Exception? innerException, System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : string * Exception * System.Threading.CancellationToken -> unit
Public Shared Sub ThrowOperationCanceledException (message As String, innerException As Exception, token As CancellationToken)
Parameters
- message
- String
The message to include in the exception.
- token
- CancellationToken
The CancellationToken in use.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowOperationCanceledException(String, Exception)
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException (string? message, Exception? innerException);
static member ThrowOperationCanceledException : string * Exception -> unit
Public Shared Sub ThrowOperationCanceledException (message As String, innerException As Exception)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowOperationCanceledException(String, CancellationToken)
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException (string? message, System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : string * System.Threading.CancellationToken -> unit
Public Shared Sub ThrowOperationCanceledException (message As String, token As CancellationToken)
Parameters
- message
- String
The message to include in the exception.
- token
- CancellationToken
The CancellationToken in use.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowOperationCanceledException(String)
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException (string? message);
static member ThrowOperationCanceledException : string -> unit
Public Shared Sub ThrowOperationCanceledException (message As String)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowOperationCanceledException()
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException ();
static member ThrowOperationCanceledException : unit -> unit
Public Shared Sub ThrowOperationCanceledException ()
Exceptions
Thrown with no parameters.
Applies to
ThrowOperationCanceledException(CancellationToken)
Throws a new OperationCanceledException.
public static void ThrowOperationCanceledException (System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : System.Threading.CancellationToken -> unit
Public Shared Sub ThrowOperationCanceledException (token As CancellationToken)
Parameters
- token
- CancellationToken
The CancellationToken in use.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowOperationCanceledException<T>(String, Exception, CancellationToken)
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> (string? message, Exception? innerException, System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : string * Exception * System.Threading.CancellationToken -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) (message As String, innerException As Exception, token As CancellationToken) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
- token
- CancellationToken
The CancellationToken in use.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowOperationCanceledException<T>(String, CancellationToken)
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> (string? message, System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : string * System.Threading.CancellationToken -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) (message As String, token As CancellationToken) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
- token
- CancellationToken
The CancellationToken in use.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.
Applies to
ThrowOperationCanceledException<T>(String, Exception)
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> (string? message, Exception? innerException);
static member ThrowOperationCanceledException : string * Exception -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) (message As String, innerException As Exception) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowOperationCanceledException<T>()
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> ();
static member ThrowOperationCanceledException : unit -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) () As T
Type Parameters
- T
The type of expected result.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with no parameters.
Applies to
ThrowOperationCanceledException<T>(String)
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> (string? message);
static member ThrowOperationCanceledException : string -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) (message As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- message
- String
The message to include in the exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowOperationCanceledException<T>(CancellationToken)
Throws a new OperationCanceledException.
public static T ThrowOperationCanceledException<T> (System.Threading.CancellationToken token);
static member ThrowOperationCanceledException : System.Threading.CancellationToken -> 'T
Public Shared Function ThrowOperationCanceledException(Of T) (token As CancellationToken) As T
Type Parameters
- T
The type of expected result.
Parameters
- token
- CancellationToken
The CancellationToken in use.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameters.