ErrorDetails Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Provides additional error information for an error record, such as a more detailed replacement error message.

Namespace:   System.Management.Automation
Assembly:  System.Management.Automation (in System.Management.Automation.dll)

System.Object
  System.Management.Automation.ErrorDetails

[SerializableAttribute]
public class ErrorDetails : ISerializable

NameDescription
System_CAPS_pubmethodErrorDetails(Assembly, String, String, Object[])

Initializes a new instance of the ErrorDetails class that contains a localizable version of a message based on a template string supplied by an assembly.

System_CAPS_pubmethodErrorDetails(Cmdlet, String, String, Object[])

Initializes a new instance of the ErrorDetails class that contains a localizable version of a message based on a template string supplied by a cmdlet.

System_CAPS_pubmethodErrorDetails(IResourceSupplier, String, String, Object[])

Initializes a new instance of the ErrorDetails class that contains a localizable version of a message based on a template string supplied by a Windows PowerShell provider.

System_CAPS_protmethodErrorDetails(SerializationInfo, StreamingContext)

Initializes a new instance of the ErrorDetails class that contains information read from the provided serialization information.

System_CAPS_pubmethodErrorDetails(String)

Initializes a new instance of the ErrorDetails class that contains a replacement error message.

NameDescription
System_CAPS_pubpropertyMessage

Gets the message that replaces the original exception message.

System_CAPS_pubpropertyRecommendedAction

Gets or sets the recommended action that should be taken as a result of this error.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetObjectData(SerializationInfo, StreamingContext)

Provides serialization functionality for the ISerializable interface.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

Retrieves a string representation of the ErrorDetails object.(Overrides Object.ToString().)

ErrorDetails represents additional details about an ErrorRecord, starting with a replacement Message. Clients can use ErrorDetails when they want to display a more specific Message than the one contained in a particular Exception, without having to create a new Exception or define a new Exception class. It is permitted to subclass ErrorDetails but there is no established scenario for doing this, nor has it been tested. The information provided by the ErrorDetails object is accessed through the ErrorRecord.ErrorDetails property. Cmdlets can use this detailed information when they need to display a more specific error message than the exception message contained in an exception, without having to create a new exception or define a new exception class. Note that the exception message is a read-only property.

For more information about error records, see Windows PowerShell Error Records.

The ErrorDetails class is used only by the Windows PowerShell runtime. There are no established scenarios for deriving from this class.

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

Return to top
Show: