IContainsErrorRecord.ErrorRecord Property

Gets the error record that describes the error that occurred.


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

'Usage
Dim instance As IContainsErrorRecord
Dim value As ErrorRecord

value = instance.ErrorRecord

ErrorRecord ErrorRecord { get; }
/** @property */
ErrorRecord get_ErrorRecord ()

function get ErrorRecord () : ErrorRecord

Property Value

Returns an ErrorRecord object that describes the error that occurred.

The error record retrieved by this property should contain a ParentContainsErrorRecordException object in the Exception property of the record rather than a reference to the root, or inner exception, of the record. This prevents a recursive reference between the exception implementing this interface and the error record returned by this property.

When implementing this property, use the ParentContainsErrorRecordException constructor when setting the Exception property of the error record to ensure that the ParentContainsErrorRecordException object has the same exception message as the root exception.


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

 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft