ErrorWrapper Constructors

Definition

Initializes a new instance of the ErrorWrapper class.

Overloads

ErrorWrapper(Exception)

Initializes a new instance of the ErrorWrapper class with the HRESULT that corresponds to the exception supplied.

ErrorWrapper(Int32)

Initializes a new instance of the ErrorWrapper class with the HRESULT of the error.

ErrorWrapper(Object)

Initializes a new instance of the ErrorWrapper class with an object containing the HRESULT of the error.

ErrorWrapper(Exception)

Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs

Initializes a new instance of the ErrorWrapper class with the HRESULT that corresponds to the exception supplied.

C#
public ErrorWrapper(Exception e);

Parameters

e
Exception

The exception to be converted to an error code.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

ErrorWrapper(Int32)

Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs

Initializes a new instance of the ErrorWrapper class with the HRESULT of the error.

C#
public ErrorWrapper(int errorCode);

Parameters

errorCode
Int32

The HRESULT of the error.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

ErrorWrapper(Object)

Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs
Source:
ErrorWrapper.cs

Initializes a new instance of the ErrorWrapper class with an object containing the HRESULT of the error.

C#
public ErrorWrapper(object errorCode);

Parameters

errorCode
Object

The object containing the HRESULT of the error.

Exceptions

The errorCode parameter is not an Int32 type.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0