Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ErrorHandler Class
Collapse the table of content
Expand the table of content

ErrorHandler Class

Provides methods for dealing with common COM error codes.


Namespace:  Microsoft.VisualStudio
Assemblies:   Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

public sealed class ErrorHandler

The ErrorHandler type exposes the following members.

Public methodStatic memberCallWithCOMConvention(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.
Public methodStatic memberCallWithCOMConvention(Func<Int32>, Boolean)
Public methodStatic memberContainsCriticalException
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberExceptionToHResult
Public methodStatic memberFailedDetermines whether an HRESULT is an error return code.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberIsCriticalExceptionDetermines whether the specified exception is critical.
Public methodStatic memberIsRejectedRpcCallDetermines whether the parameter is a failure HRESULT that indicates a failed RPC call that may succeed if retried at a later time.
Public methodStatic memberSucceededDetermines whether an HRESULT is a success return code.
Public methodStatic memberThrowOnFailure(Int32)Determines whether the parameter is a success or failure HRESULT and throws an exception in case of failure.
Public methodStatic memberThrowOnFailure(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.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft