ErrorHandler Class

Provides methods for dealing with common COM error codes.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.ErrorHandler

Namespace:  Microsoft.VisualStudio
Assembly:  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'Declaration
Public NotInheritable Class ErrorHandler
public sealed class ErrorHandler
public ref class ErrorHandler sealed
[<Sealed>]
type ErrorHandler =  class end
public final class ErrorHandler

The ErrorHandler type exposes the following members.

Methods

  Name Description
Public methodStatic member CallWithCOMConvention(Action) Catches all but critical exceptions and returns the corresponding HRESULT.
Public methodStatic member CallWithCOMConvention(Func<TResult>) Catches all but critical exceptions and returns the corresponding HRESULT.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public methodStatic member Failed Determines whether an HRESULT is an error return code.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member IsCriticalException Determines whether the specified exception is critical.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic member Succeeded Determines whether an HRESULT is a success return code.
Public methodStatic member ThrowOnFailure(Int32) Determines whether the parameter is a success or failure HRESULT and throws an exception in case of failure.
Public methodStatic member ThrowOnFailure(Int32, array<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 method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Thread Safety

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

See Also

Reference

Microsoft.VisualStudio Namespace

Other Resources

HRESULT Information in Managed Code