ErrorHandler Class

Definition

Provides methods for dealing with common COM error codes.

public ref class ErrorHandler sealed
public ref class ErrorHandler sealed
class ErrorHandler sealed
public sealed class ErrorHandler
type ErrorHandler = class
Public NotInheritable Class ErrorHandler
Inheritance
ErrorHandler

Methods

CallWithCOMConvention(Action, Boolean)

Use this method when an interop interface might be implemented by managed code, and it is expected to return HRESULT error codes but also throws exceptions. This method catches all except the critical exceptions and returns the corresponding HRESULT for the caught exception.

CallWithCOMConvention(Func<Int32>, Boolean)
ContainsCriticalException(AggregateException)
ExceptionToHResult(Exception, Boolean)
Failed(Int32)

Determines whether an HRESULT is an error return code.

IsCriticalException(Exception)

Determines whether the specified exception is critical.

IsRejectedRpcCall(Int32)

Determines whether the parameter is a failure HRESULT that indicates a failed RPC call that may succeed if retried at a later time.

Succeeded(Int32)

Determines whether an HRESULT is a success return code.

ThrowOnFailure(Int32)

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

ThrowOnFailure(Int32, Int32[])

Determines whether 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.

Applies to