ErrorHandler.ThrowOnFailure Method

Definition

Overloads

ThrowOnFailure(Int32)

Checks if the parameter is a success or failure HRESULT and throws an exception in case of failure.

ThrowOnFailure(Int32, Int32[])

Checks if the parameter is a success or failure HRESULT and throws an exception if it is a failure that is not included in the array of well-known failures.

ThrowOnFailure(Int32)

Checks if the parameter is a success or failure HRESULT and throws an exception in case of failure.

public:
 static int ThrowOnFailure(int hr);
public:
 static int ThrowOnFailure(int hr);
 static int ThrowOnFailure(int hr);
public static int ThrowOnFailure (int hr);
static member ThrowOnFailure : int -> int
Public Shared Function ThrowOnFailure (hr As Integer) As Integer

Parameters

hr
Int32

The HRESULT to test.

Returns

The HRESULT.

Applies to

ThrowOnFailure(Int32, Int32[])

Checks if the parameter is a success or failure HRESULT and throws an exception if it is a failure that is not included in the array of well-known failures.

public:
 static int ThrowOnFailure(int hr, ... cli::array <int> ^ expectedHRFailure);
public static int ThrowOnFailure (int hr, params int[] expectedHRFailure);
static member ThrowOnFailure : int * int[] -> int
Public Shared Function ThrowOnFailure (hr As Integer, ParamArray expectedHRFailure As Integer()) As Integer

Parameters

hr
Int32

The HRESULT to test.

expectedHRFailure
Int32[]

Array of well-known and expected failures.

Returns

The HRESULT.

Applies to