ThrowHelper.ThrowWin32Exception 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
ThrowWin32Exception(String, Exception) |
Throws a new Win32Exception. |
ThrowWin32Exception() |
Throws a new Win32Exception. |
ThrowWin32Exception(Int32) |
Throws a new Win32Exception. |
ThrowWin32Exception(String) |
Throws a new Win32Exception. |
ThrowWin32Exception(Int32, String) |
Throws a new Win32Exception. |
ThrowWin32Exception<T>(String) |
Throws a new Win32Exception. |
ThrowWin32Exception<T>(Int32, String) |
Throws a new Win32Exception. |
ThrowWin32Exception<T>() |
Throws a new Win32Exception. |
ThrowWin32Exception<T>(Int32) |
Throws a new Win32Exception. |
ThrowWin32Exception<T>(String, Exception) |
Throws a new Win32Exception. |
ThrowWin32Exception(String, Exception)
Throws a new Win32Exception.
public static void ThrowWin32Exception (string? message, Exception? innerException);
static member ThrowWin32Exception : string * Exception -> unit
Public Shared Sub ThrowWin32Exception (message As String, innerException As Exception)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowWin32Exception()
Throws a new Win32Exception.
public static void ThrowWin32Exception ();
static member ThrowWin32Exception : unit -> unit
Public Shared Sub ThrowWin32Exception ()
Exceptions
Thrown with no parameters.
Applies to
ThrowWin32Exception(Int32)
Throws a new Win32Exception.
public static void ThrowWin32Exception (int error);
static member ThrowWin32Exception : int -> unit
Public Shared Sub ThrowWin32Exception (error As Integer)
Parameters
- error
- Int32
The Win32 error code associated with this exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowWin32Exception(String)
Throws a new Win32Exception.
public static void ThrowWin32Exception (string? message);
static member ThrowWin32Exception : string -> unit
Public Shared Sub ThrowWin32Exception (message As String)
Parameters
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowWin32Exception(Int32, String)
Throws a new Win32Exception.
public static void ThrowWin32Exception (int error, string? message);
static member ThrowWin32Exception : int * string -> unit
Public Shared Sub ThrowWin32Exception (error As Integer, message As String)
Parameters
- error
- Int32
The Win32 error code associated with this exception.
- message
- String
The message to include in the exception.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowWin32Exception<T>(String)
Throws a new Win32Exception.
public static T ThrowWin32Exception<T> (string? message);
static member ThrowWin32Exception : string -> 'T
Public Shared Function ThrowWin32Exception(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
ThrowWin32Exception<T>(Int32, String)
Throws a new Win32Exception.
public static T ThrowWin32Exception<T> (int error, string? message);
static member ThrowWin32Exception : int * string -> 'T
Public Shared Function ThrowWin32Exception(Of T) (error As Integer, message As String) As T
Type Parameters
- T
The type of expected result.
Parameters
- error
- Int32
The Win32 error code associated with this exception.
- 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
ThrowWin32Exception<T>()
Throws a new Win32Exception.
public static T ThrowWin32Exception<T> ();
static member ThrowWin32Exception : unit -> 'T
Public Shared Function ThrowWin32Exception(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
ThrowWin32Exception<T>(Int32)
Throws a new Win32Exception.
public static T ThrowWin32Exception<T> (int error);
static member ThrowWin32Exception : int -> 'T
Public Shared Function ThrowWin32Exception(Of T) (error As Integer) As T
Type Parameters
- T
The type of expected result.
Parameters
- error
- Int32
The Win32 error code associated with this exception.
Returns
This method always throws, so it actually never returns a value.
Exceptions
Thrown with the specified parameter.
Applies to
ThrowWin32Exception<T>(String, Exception)
Throws a new Win32Exception.
public static T ThrowWin32Exception<T> (string? message, Exception? innerException);
static member ThrowWin32Exception : string * Exception -> 'T
Public Shared Function ThrowWin32Exception(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.