Windows desktop applications
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ErrorRecord Class

 

Updated: April 27, 2016

Applies To: Windows PowerShell

Describes a terminating or nonterminating error that occurred during the processing of a command.

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


<SerializableAttribute>
Public Class ErrorRecord
	Implements ISerializable

NameDescription
System_CAPS_pubmethodErrorRecord(ErrorRecord, Exception)

Initializes a new instance of the ErrorRecord class that contains a wrapper exception that already has an error record. Introduced in Windows PowerShell 3.0.

System_CAPS_pubmethodErrorRecord(Exception, String, ErrorCategory, Object)

Initializes a new instance of the ErrorRecord class that contains the exception, error identifier, error category, and more.

System_CAPS_protmethodErrorRecord(SerializationInfo, StreamingContext)

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

NameDescription
System_CAPS_pubpropertyCategoryInfo

Gets information about the category of the error.

System_CAPS_pubpropertyErrorDetails

Gets and sets more detailed error information, such as a replacement error message.

System_CAPS_pubpropertyException

Gets the exception that is associated with this error record.

System_CAPS_pubpropertyFullyQualifiedErrorId

Gets the fully qualified error identifier for this error record.

System_CAPS_pubpropertyInvocationInfo

Gets information about the command that was invoked when the error occurred.

System_CAPS_pubpropertyPipelineIterationInfo

Gets the status of the pipeline when this error record was created. This property is introduced in Windows PowerShell 2.0.

System_CAPS_pubpropertyScriptStackTrace

Gets the script stack trace for the error. Introduced in Windows PowerShell 3.0.

System_CAPS_pubpropertyTargetObject

Gets the object that was being processed when the error occurred.

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 current ErrorRecord object.(Overrides Object.ToString().)

The ErrorRecord class is used only by the Windows PowerShell runtime. There are no established scenarios for deriving from this class. For more information about error records, see Windows PowerShell Error Records.

Error records that describe terminating errors are reported when the Cmdlet.ThrowTerminatingError method and the CmdletProvider.ThrowTerminatingError method are called.

Error records that describe nonterminating errors are reported by calling the Cmdlet.WriteError method and the CmdletProvider.WriteError method.

Error records are also used by several exceptions that are thrown by the Windows PowerShell runtime.

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:
© 2016 Microsoft